A module that allows tagging sets, while maintaining an API parallel to Set.
A common idea is wanting to store a value that is not comparable in Set a.
Since we can't currently do that there are many different ways to address the problem.
One way to solve that problem is to use a type level assertion.
Rather than holding on to an entirely different type for the values and threading a comparison function through,
we can just tell elm that we'd like to tag the Set a at compile time.
Doing so allows us to reuse the underlying behavior of the Set a with very little runtime overhead.
Most functions here are simple wrappers to refine the types without modifying the values.
Create an empty set.
Create a set with one value.
Insert a value pair into a set.
Remove a value from a set. If the value is not found, no changes are made.
Determine if a set is empty.
Determine if a value is in a set.
Determine the number of values in a set.
Convert a set into a sorted list of untagged values.
Convert an untagged list into a set.
Convert a set into a sorted list of tagged values.
Convert a list into a set.
Apply a function to all values in a set.
Fold over the values in a set, in order from lowest value to highest value.
Fold over the values in a set, in order from highest value to lowest value.
Create a new set consisting only of elements which satisfy a predicate.
Create two new sets; the first consisting of elements which satisfy a predicate, the second consisting of elements which do not.
Get the union of two sets. Keep all values.
Get the intersection of two sets. Keeps values that appear in both sets.
Get the difference between the first set and the second. Keeps values that do not appear in the second set.
A set that tags the values with an additional constraint.
The constraint is phantom in that it doesn't show up at runtime.