:: a -> Set a -> Set a -package:nonempty-containers

O(n) Prepend an element.
O(n) Prepend an element
Insert an element in a set. If the set already contains an element equal to the given value, it is replaced with the new value.
Delete an element from a set.
O(log n). Insert an element in a set. If the set already contains an element equal to the given value, it is replaced with the new value.
O(log n). Delete an element from a set.
Append an element to the end of a Set
Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.

Examples

Perform a computation with Maybe and replace the result with a constant value if it is Just:
>>> 'a' <$ Just 2
Just 'a'

>>> 'a' <$ Nothing
Nothing
Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version. Using ApplicativeDo: 'a <$ bs' can be understood as the do expression
do bs
pure a
with an inferred Functor constraint.
Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.
Cons element to the vector
Append element to the vector
Insert a new element into the collection. Since the Set type does not allow duplicates, inserting an element already in the collection has no effect.
Remove an element from the collection if present.
scale a vector by a scalar
Compute the left scalar product
>>> 2 *^ V2 3 4
V2 6 8
Add a value to the set. When the value is already an element of the set, it is replaced by the new one, ie. insert is left-biased.
Delete a value in the set. Returns the original set when the value was not present.
O(n) Append an element.
O(n) Append an element