Safe Haskell | Unsafe |
---|
- data Map f
- empty :: Map f
- null :: Map f -> Bool
- singleton :: StableName a -> f a -> Map f
- member :: StableName a -> Map f -> Bool
- notMember :: StableName a -> Map f -> Bool
- insert :: StableName a -> f a -> Map f -> Map f
- insertWith :: (f a -> f a -> f a) -> StableName a -> f a -> Map f -> Map f
- insertWith' :: (f a -> f a -> f a) -> StableName a -> f a -> Map f -> Map f
- adjust :: (f a -> f a) -> StableName a -> Map f -> Map f
- lookup :: StableName a -> Map f -> Maybe (f a)
- find :: StableName a -> Map f -> f a
- findWithDefault :: f a -> StableName a -> Map f -> f a
Documentation
singleton :: StableName a -> f a -> Map fSource
member :: StableName a -> Map f -> BoolSource
notMember :: StableName a -> Map f -> BoolSource
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.
will insert the pair (key, value) into insertWith
f key value mpmp
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
find :: StableName a -> Map f -> f aSource
findWithDefault :: f a -> StableName a -> Map f -> f aSource
O(log n). The expression (
returns
the value at key findWithDefault
def k map)k
or returns the default value def
when the key is not in the map.