Module

Erl.Data.Map

Package
erl-maps
Repository
purerl/purescript-erl-maps

#Map Source

data Map :: Type -> Type -> Type

Instances

#alter Source

alter :: forall v k. (Maybe v -> Maybe v) -> k -> Map k v -> Map k v

Insert the value, delete a value, or update a value for a key in a map

#delete Source

delete :: forall a k. k -> Map k a -> Map k a

#difference Source

difference :: forall b a k. Map k a -> Map k b -> Map k a

#empty Source

empty :: forall b a. Map a b

#filter Source

filter :: forall v k. (v -> Boolean) -> Map k v -> Map k v

Filter out those key/value pairs of a map for which a predicate on the value fails to hold.

#filterKeys Source

filterKeys :: forall k. (k -> Boolean) -> (Map k) ~> (Map k)

Filter out those key/value pairs of a map for which a predicate on the key fails to hold.

#filterWithKey Source

filterWithKey :: forall v k. (k -> v -> Boolean) -> Map k v -> Map k v

#fromFoldable Source

fromFoldable :: forall v k f. 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. 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.

#fromFoldableWithIndex Source

fromFoldableWithIndex :: forall v k f. FoldableWithIndex k f => f v -> Map k v

Convert any indexed foldable collection into a map.

#insert Source

insert :: forall b a. a -> b -> Map a b -> Map a b

#insertWith Source

insertWith :: forall v k. (v -> v -> v) -> k -> v -> Map k v -> Map k v

Inserts or updates a value with the given function.

The combining function is called with the existing value as the first argument and the new value as the second argument.

#isEmpty Source

isEmpty :: forall b a. Map a b -> Boolean

#keys Source

keys :: forall b a. Map a b -> List a

#lookup Source

lookup :: forall b a. a -> Map a b -> Maybe b

#mapWithKey Source

mapWithKey :: forall b a k. (k -> a -> b) -> Map k a -> Map k b

#mapMaybe Source

mapMaybe :: forall b a k. (a -> Maybe b) -> Map k a -> Map k b

Applies a function to each value in a map, discarding entries where the function returns Nothing.

#mapMaybeWithKey Source

mapMaybeWithKey :: forall b a k. (k -> a -> Maybe b) -> Map k a -> Map k b

Applies a function to each key/value pair in a map, discarding entries where the function returns Nothing.

#member Source

member :: forall a k. k -> Map k a -> Boolean

#singleton Source

singleton :: forall b a. a -> b -> Map a b

#size Source

size :: forall b a. Map a b -> Int

#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 where the keys are in ascending order

#toUnfoldableUnordered Source

toUnfoldableUnordered :: forall v k f. Unfoldable f => Map k v -> f (Tuple k v)

Convert a map to an unfoldable structure of key/value pairs

#values Source

values :: forall b a. Map a b -> List b

#update Source

update :: forall v k. (v -> Maybe v) -> k -> Map k v -> Map k v

Update or delete the value for a key in a map

#union Source

union :: forall v k. Map k v -> Map k v -> Map k v
Modules
Erl.Data.Map