Module
Data.Map
- Package
- purescript-mapsDEPRECATED
- Repository
- purescript/purescript-maps
This module defines a type of maps as balanced 2-3 trees, based on http://www.cs.princeton.edu/~dpw/courses/cos326-12/ass/2-3-trees.pdf
#checkValid Source
checkValid :: forall v k. Map k v -> Boolean
Check whether the underlying tree satisfies the 2-3 invariant
This function is provided for internal use.
#fromFoldable Source
fromFoldable :: forall v k f. Ord k => Foldable f => f (Tuple k v) -> Map k v
Convert any foldable collection of key/value pairs to a map. On key collision, later values take precedence over earlier ones.
#fromFoldableWith Source
fromFoldableWith :: forall v k f. Ord k => Foldable f => (v -> v -> v) -> f (Tuple k v) -> Map k v
Convert any foldable collection of key/value pairs to a map. On key collision, the values are configurably combined.
#toUnfoldable Source
toUnfoldable :: forall v k f. Unfoldable f => Map k v -> f (Tuple k v)
Convert a map to an unfoldable structure of key/value pairs
#toAscUnfoldable Source
toAscUnfoldable :: forall v k f. Unfoldable f => Map k v -> f (Tuple k v)
Convert a map to an unfoldable structure of key/value pairs where the keys are in ascending order
#mapWithKey Source
mapWithKey :: forall v' v k. (k -> v -> v') -> Map k v -> Map k v'
Apply a function of two arguments to each key/value pair, producing a new map