reflex-0.7.1.0: Higher-order Functional Reactive Programming
Safe HaskellSafe
LanguageHaskell2010

Data.Map.Misc

Description

Additional functions for manipulating Maps.

Synopsis

Working with Maps

diffMapNoEq :: Ord k => Map k v -> Map k v -> Map k (Maybe v) Source #

Produce a Map k (Maybe v) by comparing two Map k vs, old and new respectively. Just represents an association present in new and Nothing represents an association only present in old but no longer present in new.

Similar to diffMap but doesn't require Eq on the values, thus can't tell if a value has changed or not.

diffMap :: (Ord k, Eq v) => Map k v -> Map k v -> Map k (Maybe v) Source #

Produce a Map k (Maybe v) by comparing two Map k vs, old and new respectively. Just represents an association present in new and either not present in old or where the value has changed. Nothing represents an association only present in old but no longer present in new@.

See also diffMapNoEq for a similar but weaker version which does not require Eq on the values but thus can't indicated a value not changing between old and new with Nothing.

applyMap :: Ord k => Map k (Maybe v) -> Map k v -> Map k v Source #

Given a Map k (Maybe v) representing keys to insert/update (Just) or delete (Nothing), produce a new map from the given input Map k v.

See also Map and MapWithMove.

mapPartitionEithers :: Map k (Either a b) -> (Map k a, Map k b) Source #

Deprecated: Use mapEither instead

Split a Map k (Either a b) into Map k a and Map k b, equivalent to mapEither id

applyMapKeysSet :: Ord k => Map k (Maybe v) -> Set k -> Set k Source #

Given a Map k (Maybe v) representing keys to insert/update (Just) or delete (Nothing), produce a new Set k from the given input set.

Equivalent to:

    applyMapKeysSet patch (keysSet m) == keysSet (applyMap patch m)

but avoids the intervening Map and needs no values.