Module

# Data.HashSet

- Package
- purescript-unordered-collections
- Repository
- fehrenbach/purescript-unordered-collections

### #map Source

`map :: forall a b. Hashable b => (a -> b) -> HashSet a -> HashSet b`

Construct a new set by applying a function to each element of an input set.

If distinct inputs map to the same output, this changes the
cardinality of the set, therefore hash set is not a `Functor`

.
Also, the order in which elements appear in the new set is
entirely dependent on the hash function for type `b`

.

### #intersection Source

`intersection :: forall a. Hashable a => HashSet a -> HashSet a -> HashSet a`

Intersect two sets.

### #difference Source

`difference :: forall a. Hashable a => HashSet a -> HashSet a -> HashSet a`

Difference of two sets.

Also known as set minus or relative complement. Returns a set of all elements of the left set that are not in the right set.

- Modules
- Data.
HashMap - Data.
HashSet - Data.
Hashable

The

`Foldable`

instance is best used with acommutativefunction/`Monoid`

, since hash sets do not guarantee any particular order.