stable-maps-0.0.3.2: Heterogeneous maps keyed by StableNames

Safe HaskellSafe-Infered

System.Mem.StableName.Map

Synopsis

Documentation

data Map f Source

singleton :: StableName a -> f a -> Map fSource

insert :: StableName a -> f a -> Map f -> Map fSource

insertWith :: (f a -> f a -> f a) -> StableName a -> f a -> Map f -> Map fSource

O(log n). Insert with a function for combining the new value and old value. insertWith f key value mp will insert the pair (key, value) into mp if the key does not exist in the map. If the key does exist, the function will insert the pair (key, f new_value old_value)

insertWith' :: (f a -> f a -> f a) -> StableName a -> f a -> Map f -> Map fSource

Same as insertWith, but with the combining function applied strictly.

adjust :: (f a -> f a) -> StableName a -> Map f -> Map fSource

lookup :: StableName a -> Map f -> Maybe (f a)Source

O(log n). Lookup the value at a key in the map.

The function will return the corresponding value as a (Just value) or Nothing if the key isn't in the map.

find :: StableName a -> Map f -> f aSource

findWithDefault :: f a -> StableName a -> Map f -> f aSource

O(log n). The expression (findWithDefault def k map) returns the value at key k or returns the default value def when the key is not in the map.