A set of unique elements.
The element type needs to be an instance of the same
Key
typeclass that is used for keys in the
Map type above.
Instances are already provided for many common element types.
Set implements
Foldable,
Monoid, etc so many
common operations such as
foldr to walk the elements and reduce
them,
length to return the size of the collection,
null
to test whether is empty, and (
<>) to take the union of
two sets are available.
To convert to other collection types see
fromSet below.
(this is a thin wrapper around
unordered-containers's
HashSet, but if you use the conversion functions to extract a
list the list will be ordered according to the elements'
Ord
instance)