Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class StaticMap t where
- class StaticMap t => DynamicMap t where
- (!?) :: StaticMap t => t -> Key t -> Maybe (Val t)
- notMember :: StaticMap t => Key t -> t -> Bool
- lookupDefault :: StaticMap t => Val t -> Key t -> t -> Val t
- toPairs :: (IsList t, Item t ~ (a, b)) => t -> [(a, b)]
- keys :: (IsList t, Item t ~ (a, b)) => t -> [a]
- elems :: (IsList t, Item t ~ (a, b)) => t -> [b]
Documentation
class StaticMap t where Source #
Read-only map or set. Contains polymorhic functions which work for both sets and maps.
class StaticMap t => DynamicMap t where Source #
Modifiable Map.
insert :: Key t -> Val t -> t -> t Source #
insertWith :: (Val t -> Val t -> Val t) -> Key t -> Val t -> t -> t Source #
delete :: Key t -> t -> t Source #
alter :: (Maybe (Val t) -> Maybe (Val t)) -> Key t -> t -> t Source #
Instances
(!?) :: StaticMap t => t -> Key t -> Maybe (Val t) infixl 9 Source #
Operator version of lookup
function.
Return the value to which the specified key is mapped, or the default value if this map contains no mapping for the key.
To pairs
toPairs :: (IsList t, Item t ~ (a, b)) => t -> [(a, b)] Source #
Converts the structure to the list of the key-value pairs.
>>>
toPairs (HashMap.fromList [('a', "xxx"), ('b', "yyy")])
[('a',"xxx"),('b',"yyy")]