Module

JS.Map.Primitive

Package
purescript-js-maps
Repository
gbagan/purescript-js-maps

Re-exports from JS.Map.Primitive.Internal

#Map Source

data Map t0 t1

Instances

#values Source

values :: forall k v. Map k v -> Array v

Get a list of the values in a map

#update Source

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

Remove or update a value for a key in a map

#unions Source

unions :: forall f k v. Key k => Foldable f => f (Map k v) -> Map k v

Compute the union of a collection of maps

#unionWith Source

unionWith :: forall k v. Key k => (v -> v -> v) -> Map k v -> Map k v -> Map k v

Compute the union of two maps, using the specified function to combine values for duplicate keys.

#union Source

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

Compute the union of two maps, preferring the first map in the case of duplicate keys.

#toUnfoldable Source

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

Unfolds a map into a list of key/value pairs

#toAscUnfoldable Source

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

Unfolds a map into a list of key/value pairs which is guaranteed to be sorted by key

#toArrayWithKey Source

toArrayWithKey :: forall k v a. (k -> v -> a) -> Map k v -> Array a

#size Source

size :: forall k v. Map k v -> Int

Calculate the number of key/value pairs in a map

#singleton Source

singleton :: forall k v. Key k => k -> v -> Map k v

Create an Map a with one key/value pair

#pop Source

pop :: forall k v. Key k => k -> Map k v -> Maybe (Tuple v (Map k v))

Delete a key and value from a map, returning the value as well as the subsequent map

#member Source

member :: forall k v. Key k => k -> Map k v -> Boolean

Test whether a key appears in a map

#mapWithKey Source

mapWithKey :: forall k v v'. Key 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

#lookup Source

lookup :: forall k v. Key k => k -> Map k v -> Maybe v

Lookup the value for a key in a map

#keys Source

keys :: forall k v. Map k v -> Array k

Get an array of the keys in a map

#isSubmap Source

isSubmap :: forall k v. Key k => Eq v => Map k v -> Map k v -> Boolean

Test whether one map contains all of the keys and values contained in another map

#isEmpty Source

isEmpty :: forall k v. Key k => Map k v -> Boolean

Test whether a map is empty

#insert Source

insert :: forall k v. Key k => k -> v -> Map k v -> Map k v

Insert or replace a key/value pair in a map

#fromFoldableWithIndex Source

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

Create an Map k v from a k-indexed foldable collection

#fromFoldableWith Source

fromFoldableWith :: forall f k v. Key k => Foldable f => (v -> v -> v) -> f (Tuple k v) -> Map k v

Create an Map k v from a foldable collection of key/value pairs, using the specified function to combine values for duplicate keys.

#fromFoldable Source

fromFoldable :: forall f k v. Key k => Foldable f => f (Tuple k v) -> Map k v

Create an Map k v from a foldable collection of key/value pairs

#foldMaybe Source

foldMaybe :: forall k v z. Key k => (z -> k -> v -> Maybe z) -> z -> Map k v -> z

Fold the keys and values of a map.

This function allows the folding function to terminate the fold early, using Maybe.

#foldMap Source

foldMap :: forall k v m. Key k => Monoid m => (k -> v -> m) -> Map k v -> m

Fold the keys and values of an object, accumulating values using some Monoid.

#foldM Source

foldM :: forall k v m z. Key k => Monad m => (z -> k -> v -> m z) -> z -> Map k v -> m z

Fold the keys and values of an object, accumulating values and effects in some Monad.

#fold Source

fold :: forall k v z. Key k => (z -> k -> v -> z) -> z -> Map k v -> z

Fold the keys and values of an object

#filterWithKey Source

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

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

#filterKeys Source

filterKeys :: forall k. Key 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.

#filter Source

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

#empty Source

empty :: forall k v. Map k v

An empty map

#delete Source

delete :: forall k v. Key k => k -> Map k v -> Map k v

Delete a key and value from a map

#alter Source

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

Insert, remove or update a value for a key in a map

#all Source

all :: forall k v. Key k => (k -> v -> Boolean) -> Map k v -> Boolean

Test whether all key/value pairs in a Map satisfy a predicate.