Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Documentation
class Foldable (m k) => Map m k where Source #
Minimal complete implementation:
eqCmp
null
lookup
alter
unionWithKey
,differenceWithKey
,intersectionWithKey
toListKV
empty
orfromList
orfromListWith
isSubmapOfBy
For decent performance, supplying at least mapAccumWithKey
and filter
as
well is probably a good idea.
eqCmp, null, lookup, alter, unionWithKey, differenceWithKey, intersectionWithKey, toListKV, isSubmapOfBy
eqCmp :: m k a -> k -> k -> Bool Source #
Like an Eq
instance over k, but should compare on the same type as
m
does. In most cases this can be defined just as const (==)
.
singleton :: k -> a -> m k a Source #
doubleton :: k -> a -> k -> a -> m k a Source #
Precondition: the two keys differ
null :: m k a -> Bool Source #
lookup :: k -> m k a -> Maybe a Source #
insertWith :: (a -> a -> a) -> k -> a -> m k a -> m k a Source #
Strictness can be whatever is more optimal for the map type, shouldn't matter
insert :: k -> a -> m k a -> m k a Source #
update :: (a -> Maybe a) -> k -> m k a -> m k a Source #
adjust :: (a -> a) -> k -> m k a -> m k a Source #
delete :: k -> m k a -> m k a Source #
alter :: (Maybe a -> Maybe a) -> k -> m k a -> m k a Source #
unionWith :: (a -> a -> a) -> m k a -> m k a -> m k a Source #
differenceWith :: (a -> b -> Maybe a) -> m k a -> m k b -> m k a Source #
intersectionWith :: (a -> b -> c) -> m k a -> m k b -> m k c Source #
unionWithKey :: (k -> a -> a -> a) -> m k a -> m k a -> m k a Source #
differenceWithKey :: (k -> a -> b -> Maybe a) -> m k a -> m k b -> m k a Source #
intersectionWithKey :: (k -> a -> b -> c) -> m k a -> m k b -> m k c Source #
map :: (a -> b) -> m k a -> m k b Source #
mapWithKey :: (k -> a -> b) -> m k a -> m k b Source #
mapAccum :: (a -> b -> (a, c)) -> a -> m k b -> (a, m k c) Source #
mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> m k b -> (a, m k c) Source #
filter :: (a -> Bool) -> m k a -> m k a Source #
toListKV :: m k a -> [(k, a)] Source #
fromListKV :: [(k, a)] -> m k a Source #
fromListKVWith :: (a -> a -> a) -> [(k, a)] -> m k a Source #
serializeToList :: m k a -> [(k, a)] Source #
deserializeFromList :: [(k, a)] -> m k a Source #
isSubmapOfBy :: (a -> b -> Bool) -> m k a -> m k b -> Bool Source #
singletonView :: m k a -> Maybe (k, a) Source #
class Map m k => OrdMap m k where Source #
Minimal complete definition:
For decent performance, supplying at least the following is probably a good idea:
ordCmp :: m k a -> k -> k -> Ordering Source #
Like an Ord instance over k, but should compare on the same type as m
does. In most cases this can be defined just as const compare
.
toAscList :: m k a -> [(k, a)] Source #
toDescList :: m k a -> [(k, a)] Source #
splitLookup :: k -> m k a -> (m k a, Maybe a, m k a) Source #
split :: k -> m k a -> (m k a, m k a) Source #
minViewWithKey :: m k a -> (Maybe (k, a), m k a) Source #
maxViewWithKey :: m k a -> (Maybe (k, a), m k a) Source #
findPredecessor :: k -> m k a -> Maybe (k, a) Source #
findSuccessor :: k -> m k a -> Maybe (k, a) Source #
mapAccumAsc :: (a -> b -> (a, c)) -> a -> m k b -> (a, m k c) Source #
mapAccumAscWithKey :: (a -> k -> b -> (a, c)) -> a -> m k b -> (a, m k c) Source #
mapAccumDesc :: (a -> b -> (a, c)) -> a -> m k b -> (a, m k c) Source #
mapAccumDescWithKey :: (a -> k -> b -> (a, c)) -> a -> m k b -> (a, m k c) Source #
data WrappedIntMap k v Source #
Enum k => OrdMap WrappedIntMap k Source # | |
Enum k => Map WrappedIntMap k Source # | |
Functor (WrappedIntMap k) Source # | |
Foldable (WrappedIntMap k) Source # | |
Traversable (WrappedIntMap k) Source # | |
Eq v => Eq (WrappedIntMap k v) Source # | |
Ord v => Ord (WrappedIntMap k v) Source # | |