Safe Haskell | Unsafe |
---|
- data Map a
- empty :: Map a
- null :: Map a -> Bool
- singleton :: DynamicStableName -> a -> Map a
- member :: DynamicStableName -> Map a -> Bool
- notMember :: DynamicStableName -> Map a -> Bool
- insert :: DynamicStableName -> a -> Map a -> Map a
- insertWith :: (a -> a -> a) -> DynamicStableName -> a -> Map a -> Map a
- insertWith' :: (a -> a -> a) -> DynamicStableName -> a -> Map a -> Map a
- lookup :: DynamicStableName -> Map v -> Maybe v
- find :: DynamicStableName -> Map v -> v
- findWithDefault :: v -> DynamicStableName -> Map v -> v
Documentation
singleton :: DynamicStableName -> a -> Map aSource
member :: DynamicStableName -> Map a -> BoolSource
notMember :: DynamicStableName -> Map a -> BoolSource
insert :: DynamicStableName -> a -> Map a -> Map aSource
insertWith :: (a -> a -> a) -> DynamicStableName -> a -> Map a -> Map aSource
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' :: (a -> a -> a) -> DynamicStableName -> a -> Map a -> Map aSource
Same as insertWith
, but with the combining function applied strictly.
lookup :: DynamicStableName -> Map v -> Maybe vSource
find :: DynamicStableName -> Map v -> vSource
findWithDefault :: v -> DynamicStableName -> Map v -> vSource
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.