Module
Data.HashMap
- Package
- purescript-unordered-collections
- Repository
- fehrenbach/purescript-unordered-collections
#HashMap Source
data HashMap :: Type -> Type -> Type
Immutable hash maps from keys k
to values v
.
Note that this is an unordered collection.
Instances
(Eq k, Eq v) => Eq (HashMap k v)
(Hashable k, Hashable v) => Hashable (HashMap k v)
(Hashable k) => Monoid (HashMap k v)
(Hashable k) => Semigroup (HashMap k v)
Functor (HashMap k)
FunctorWithIndex k (HashMap k)
Foldable (HashMap k)
The
Foldable
instance is best used with a commutative function/Monoid
, since hash maps do not guarantee any particular order.FoldableWithIndex k (HashMap k)
The
FoldableWithIndex
instance is best used with a commutative function/Monoid
, since hash maps do not guarantee any particular order.Traversable (HashMap k)
TraversableWithIndex k (HashMap k)
(Show k, Show v) => Show (HashMap k v)
#fromFoldable Source
fromFoldable :: forall v k f. Foldable f => Hashable k => f (Tuple k v) -> HashMap k v
Turn a foldable functor of pairs into a hash map.
In the presence of duplicate keys, later (by foldl
) mappings
overwrite earlier mappings.
- Modules
- Data.
HashMap - Data.
Hashable
This is "the shallow" semigroup instance, where maps themselves are combined using
union
rather than elements being combined. For duplicate keys, values from the left map are preserved.