Module

Erl.Data.Map

#Map

data Map t0 t1

Instances

#alter

alter :: forall k v. (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

#alterM

alterM :: forall k v m. Functor m => (Maybe v -> m (Maybe v)) -> k -> Map k v -> m (Map k v)

#delete

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

#difference

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

#empty

empty :: forall a b. Map a b

#filter

filter :: forall k v. (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

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

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

#foldM

foldM :: forall a b m z. Monad m => (z -> a -> b -> m z) -> z -> Map a b -> m z

Fold the keys and values of a map, accumulating values and effects in some Monad.

#fromFoldable

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

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

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

Convert any indexed foldable collection into a map.

#insert

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

#insertWith

insertWith :: forall k v. (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

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

#keys

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

#lookup

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

#mapWithKey

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

#mapMaybe

mapMaybe :: forall k a b. (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

mapMaybeWithKey :: forall k a b. (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

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

#singleton

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

#size

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

#toUnfoldable

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

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

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

#values

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

#update

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

Update or delete the value for a key in a map

#updateM

updateM :: forall k v m. Applicative m => (v -> m (Maybe v)) -> k -> Map k v -> m (Map k v)

#union

union :: forall k v. Map k v -> Map k v -> Map k v

Modules