Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a Map
variant which uses the value's
Monoid
instance to accumulate conflicting entries when merging
Map
s.
While some functions mirroring those of Map
are provided
here for convenience, more specialized needs will likely want to use
either the Newtype
or Wrapped
instances to manipulate the
underlying Map
.
Synopsis
- newtype MonoidalMap k a = MonoidalMap {
- getMonoidalMap :: Map k a
- singleton :: k -> a -> MonoidalMap k a
- size :: MonoidalMap k a -> Int
- member :: Ord k => k -> MonoidalMap k a -> Bool
- notMember :: Ord k => k -> MonoidalMap k a -> Bool
- findWithDefault :: Ord k => a -> k -> MonoidalMap k a -> a
- assocs :: MonoidalMap k a -> [(k, a)]
- elems :: MonoidalMap k a -> [a]
- keys :: MonoidalMap k a -> [k]
- (!?) :: Ord k => MonoidalMap k a -> k -> Maybe a
- (!) :: Ord k => MonoidalMap k a -> k -> a
- (\\) :: Ord k => MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
- adjust :: Ord k => (a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a
- adjustWithKey :: Ord k => (k -> a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a
- alter :: Ord k => (Maybe a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
- delete :: Ord k => k -> MonoidalMap k a -> MonoidalMap k a
- deleteAt :: Int -> MonoidalMap k a -> MonoidalMap k a
- take :: Int -> MonoidalMap k a -> MonoidalMap k a
- drop :: Int -> MonoidalMap k a -> MonoidalMap k a
- splitAt :: Int -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
- lookupMin :: MonoidalMap k a -> Maybe (k, a)
- lookupMax :: MonoidalMap k a -> Maybe (k, a)
- deleteFindMax :: MonoidalMap k a -> ((k, a), MonoidalMap k a)
- deleteFindMin :: MonoidalMap k a -> ((k, a), MonoidalMap k a)
- deleteMax :: MonoidalMap k a -> MonoidalMap k a
- deleteMin :: MonoidalMap k a -> MonoidalMap k a
- difference :: Ord k => MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
- differenceWith :: Ord k => (a -> b -> Maybe a) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
- differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
- elemAt :: Int -> MonoidalMap k a -> (k, a)
- empty :: MonoidalMap k a
- filter :: forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
- filterWithKey :: (k -> a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
- restrictKeys :: Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a
- withoutKeys :: Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a
- findIndex :: Ord k => k -> MonoidalMap k a -> Int
- findMax :: MonoidalMap k a -> (k, a)
- findMin :: MonoidalMap k a -> (k, a)
- foldMapWithKey :: forall k a m. Monoid m => (k -> a -> m) -> MonoidalMap k a -> m
- foldl :: forall k a b. (a -> b -> a) -> a -> MonoidalMap k b -> a
- foldl' :: forall k a b. (a -> b -> a) -> a -> MonoidalMap k b -> a
- foldlWithKey :: forall k a b. (a -> k -> b -> a) -> a -> MonoidalMap k b -> a
- foldlWithKey' :: forall k a b. (a -> k -> b -> a) -> a -> MonoidalMap k b -> a
- foldr :: forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
- foldr' :: forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
- foldrWithKey :: (k -> a -> b -> b) -> b -> MonoidalMap k a -> b
- foldrWithKey' :: (k -> a -> b -> b) -> b -> MonoidalMap k a -> b
- fromAscList :: Eq k => [(k, a)] -> MonoidalMap k a
- fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
- fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
- fromDistinctAscList :: [(k, a)] -> MonoidalMap k a
- fromDistinctList :: Ord k => [(k, a)] -> MonoidalMap k a
- fromDescList :: Eq k => [(k, a)] -> MonoidalMap k a
- fromDescListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
- fromDescListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
- fromDistinctDescList :: [(k, a)] -> MonoidalMap k a
- fromList :: Ord k => [(k, a)] -> MonoidalMap k a
- fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
- fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
- fromSet :: (k -> a) -> Set k -> MonoidalMap k a
- insert :: Ord k => k -> a -> MonoidalMap k a -> MonoidalMap k a
- insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> MonoidalMap k a -> (Maybe a, MonoidalMap k a)
- insertWith :: Ord k => (a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a
- insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a
- intersectionWith :: Ord k => (a -> b -> c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
- intersectionWithKey :: Ord k => (k -> a -> b -> c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
- isProperSubmapOf :: (Ord k, Eq a) => MonoidalMap k a -> MonoidalMap k a -> Bool
- isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool
- isSubmapOf :: (Ord k, Eq a) => MonoidalMap k a -> MonoidalMap k a -> Bool
- isSubmapOfBy :: Ord k => (a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool
- keysSet :: MonoidalMap k a -> Set k
- lookup :: Ord k => k -> MonoidalMap k a -> Maybe a
- lookupGE :: Ord k => k -> MonoidalMap k a -> Maybe (k, a)
- lookupGT :: Ord k => k -> MonoidalMap k a -> Maybe (k, a)
- lookupIndex :: Ord k => k -> MonoidalMap k a -> Maybe Int
- lookupLE :: Ord k => k -> MonoidalMap k a -> Maybe (k, a)
- lookupLT :: Ord k => k -> MonoidalMap k a -> Maybe (k, a)
- map :: (a -> b) -> MonoidalMap k a -> MonoidalMap k b
- mapAccum :: forall k a b c. (a -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c)
- mapAccumRWithKey :: forall k a b c. (a -> k -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c)
- mapAccumWithKey :: forall k a b c. (a -> k -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c)
- mapEither :: forall k a b c. (a -> Either b c) -> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c)
- mapEitherWithKey :: (k -> a -> Either b c) -> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c)
- mapKeys :: forall k1 k2 a. Ord k2 => (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a
- mapKeysMonotonic :: (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a
- mapKeysWith :: forall k1 k2 a. Ord k2 => (a -> a -> a) -> (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a
- mapMaybe :: forall k a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
- mapMaybeWithKey :: (k -> a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
- mapWithKey :: (k -> a -> b) -> MonoidalMap k a -> MonoidalMap k b
- maxView :: MonoidalMap k a -> Maybe (a, MonoidalMap k a)
- maxViewWithKey :: MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a)
- mergeWithKey :: Ord k => (k -> a -> b -> Maybe c) -> (MonoidalMap k a -> MonoidalMap k c) -> (MonoidalMap k b -> MonoidalMap k c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
- minView :: MonoidalMap k a -> Maybe (a, MonoidalMap k a)
- minViewWithKey :: MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a)
- null :: MonoidalMap k a -> Bool
- partition :: forall k a. (a -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
- partitionWithKey :: (k -> a -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
- takeWhileAntitone :: (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a
- dropWhileAntitone :: (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a
- spanAntitone :: (k -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
- split :: Ord k => k -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
- splitLookup :: Ord k => k -> MonoidalMap k a -> (MonoidalMap k a, Maybe a, MonoidalMap k a)
- splitRoot :: MonoidalMap k a -> [MonoidalMap k a]
- toAscList :: MonoidalMap k a -> [(k, a)]
- toDescList :: MonoidalMap k a -> [(k, a)]
- toList :: MonoidalMap k a -> [(k, a)]
- traverseWithKey :: Applicative t => (k -> a -> t b) -> MonoidalMap k a -> t (MonoidalMap k b)
- traverseMaybeWithKey :: Applicative f => (k -> a -> f (Maybe b)) -> MonoidalMap k a -> f (MonoidalMap k b)
- unionWith :: Ord k => (a -> a -> a) -> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
- unionWithKey :: Ord k => (k -> a -> a -> a) -> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
- unionsWith :: Ord k => (a -> a -> a) -> [MonoidalMap k a] -> MonoidalMap k a
- update :: Ord k => (a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
- updateAt :: (k -> a -> Maybe a) -> Int -> MonoidalMap k a -> MonoidalMap k a
- updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> MonoidalMap k a -> (Maybe a, MonoidalMap k a)
- updateMax :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
- updateMaxWithKey :: (k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
- updateMin :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
- updateMinWithKey :: (k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
- updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
- valid :: Ord k => MonoidalMap k a -> Bool
Documentation
newtype MonoidalMap k a Source #
A Map
with monoidal accumulation
MonoidalMap | |
|
Instances
Often-needed functions
singleton :: k -> a -> MonoidalMap k a Source #
O(1). A map with a single element.
size :: MonoidalMap k a -> Int Source #
O(1). The number of elements in the map.
member :: Ord k => k -> MonoidalMap k a -> Bool Source #
O(log n). Is the key a member of the map? See also notMember
.
notMember :: Ord k => k -> MonoidalMap k a -> Bool Source #
O(log n). Is the key not a member of the map? See also member
.
findWithDefault :: Ord k => a -> k -> MonoidalMap k a -> a Source #
O(log n). The expression (
returns
the value at key findWithDefault
def k map)k
or returns default value def
when the key is not in the map.
assocs :: MonoidalMap k a -> [(k, a)] Source #
O(n). Return all elements of the map and their keys
elems :: MonoidalMap k a -> [a] Source #
O(n). Return all elements of the map in the ascending order of their keys. Subject to list fusion.
keys :: MonoidalMap k a -> [k] Source #
O(n). Return all keys of the map in ascending order. Subject to list fusion.
(!) :: Ord k => MonoidalMap k a -> k -> a infixl 9 Source #
(\\) :: Ord k => MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a infixl 9 Source #
adjust :: Ord k => (a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a Source #
adjustWithKey :: Ord k => (k -> a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a Source #
alter :: Ord k => (Maybe a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a Source #
delete :: Ord k => k -> MonoidalMap k a -> MonoidalMap k a Source #
O(log n). Delete a key and its value from the map. When the key is not a member of the map, the original map is returned.
deleteAt :: Int -> MonoidalMap k a -> MonoidalMap k a Source #
take :: Int -> MonoidalMap k a -> MonoidalMap k a Source #
drop :: Int -> MonoidalMap k a -> MonoidalMap k a Source #
splitAt :: Int -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a) Source #
lookupMin :: MonoidalMap k a -> Maybe (k, a) Source #
lookupMax :: MonoidalMap k a -> Maybe (k, a) Source #
deleteFindMax :: MonoidalMap k a -> ((k, a), MonoidalMap k a) Source #
deleteFindMin :: MonoidalMap k a -> ((k, a), MonoidalMap k a) Source #
deleteMax :: MonoidalMap k a -> MonoidalMap k a Source #
deleteMin :: MonoidalMap k a -> MonoidalMap k a Source #
difference :: Ord k => MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a Source #
differenceWith :: Ord k => (a -> b -> Maybe a) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a Source #
differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a Source #
elemAt :: Int -> MonoidalMap k a -> (k, a) Source #
empty :: MonoidalMap k a Source #
filter :: forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a Source #
filterWithKey :: (k -> a -> Bool) -> MonoidalMap k a -> MonoidalMap k a Source #
restrictKeys :: Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a Source #
withoutKeys :: Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a Source #
findMax :: MonoidalMap k a -> (k, a) Source #
findMin :: MonoidalMap k a -> (k, a) Source #
foldMapWithKey :: forall k a m. Monoid m => (k -> a -> m) -> MonoidalMap k a -> m Source #
foldl :: forall k a b. (a -> b -> a) -> a -> MonoidalMap k b -> a Source #
foldl' :: forall k a b. (a -> b -> a) -> a -> MonoidalMap k b -> a Source #
foldlWithKey :: forall k a b. (a -> k -> b -> a) -> a -> MonoidalMap k b -> a Source #
foldlWithKey' :: forall k a b. (a -> k -> b -> a) -> a -> MonoidalMap k b -> a Source #
foldr :: forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b Source #
foldr' :: forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b Source #
foldrWithKey :: (k -> a -> b -> b) -> b -> MonoidalMap k a -> b Source #
foldrWithKey' :: (k -> a -> b -> b) -> b -> MonoidalMap k a -> b Source #
fromAscList :: Eq k => [(k, a)] -> MonoidalMap k a Source #
fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a Source #
fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a Source #
fromDistinctAscList :: [(k, a)] -> MonoidalMap k a Source #
fromDistinctList :: Ord k => [(k, a)] -> MonoidalMap k a Source #
fromDescList :: Eq k => [(k, a)] -> MonoidalMap k a Source #
fromDescListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a Source #
fromDescListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a Source #
fromDistinctDescList :: [(k, a)] -> MonoidalMap k a Source #
fromList :: Ord k => [(k, a)] -> MonoidalMap k a Source #
fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a Source #
fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a Source #
fromSet :: (k -> a) -> Set k -> MonoidalMap k a Source #
insert :: Ord k => k -> a -> MonoidalMap k a -> MonoidalMap k a Source #
insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> MonoidalMap k a -> (Maybe a, MonoidalMap k a) Source #
insertWith :: Ord k => (a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a Source #
insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a Source #
intersectionWith :: Ord k => (a -> b -> c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c Source #
intersectionWithKey :: Ord k => (k -> a -> b -> c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c Source #
isProperSubmapOf :: (Ord k, Eq a) => MonoidalMap k a -> MonoidalMap k a -> Bool Source #
isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool Source #
isSubmapOf :: (Ord k, Eq a) => MonoidalMap k a -> MonoidalMap k a -> Bool Source #
isSubmapOfBy :: Ord k => (a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool Source #
keysSet :: MonoidalMap k a -> Set k Source #
lookupIndex :: Ord k => k -> MonoidalMap k a -> Maybe Int Source #
map :: (a -> b) -> MonoidalMap k a -> MonoidalMap k b Source #
mapAccum :: forall k a b c. (a -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c) Source #
mapAccumRWithKey :: forall k a b c. (a -> k -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c) Source #
mapAccumWithKey :: forall k a b c. (a -> k -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c) Source #
mapEither :: forall k a b c. (a -> Either b c) -> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c) Source #
mapEitherWithKey :: (k -> a -> Either b c) -> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c) Source #
mapKeys :: forall k1 k2 a. Ord k2 => (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a Source #
mapKeysMonotonic :: (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a Source #
O(n).
, but works only when mapKeysMonotonic
f s == mapKeys
f sf
is strictly increasing (both monotonic and injective).
That is, for any values x
and y
, if x
< y
then f x
< f y
and f
is injective (i.e. it never maps two input keys to the same output key).
The precondition is not checked.
Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls] ==> mapKeysMonotonic f s == mapKeys f s where ls = keys s
This means that f
maps distinct original keys to distinct resulting keys.
This function has better performance than mapKeys
.
mapKeysMonotonic (\ k -> k * 2) (fromList [(5,"a"), (3,"b")]) == fromList [(6, "b"), (10, "a")] valid (mapKeysMonotonic (\ k -> k * 2) (fromList [(5,"a"), (3,"b")])) == True valid (mapKeysMonotonic (\ _ -> 1) (fromList [(5,"a"), (3,"b")])) == False
mapKeysWith :: forall k1 k2 a. Ord k2 => (a -> a -> a) -> (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a Source #
mapMaybe :: forall k a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b Source #
mapMaybeWithKey :: (k -> a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b Source #
mapWithKey :: (k -> a -> b) -> MonoidalMap k a -> MonoidalMap k b Source #
maxView :: MonoidalMap k a -> Maybe (a, MonoidalMap k a) Source #
maxViewWithKey :: MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a) Source #
mergeWithKey :: Ord k => (k -> a -> b -> Maybe c) -> (MonoidalMap k a -> MonoidalMap k c) -> (MonoidalMap k b -> MonoidalMap k c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c Source #
minView :: MonoidalMap k a -> Maybe (a, MonoidalMap k a) Source #
minViewWithKey :: MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a) Source #
null :: MonoidalMap k a -> Bool Source #
partition :: forall k a. (a -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a) Source #
partitionWithKey :: (k -> a -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a) Source #
takeWhileAntitone :: (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a Source #
dropWhileAntitone :: (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a Source #
spanAntitone :: (k -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a) Source #
split :: Ord k => k -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a) Source #
splitLookup :: Ord k => k -> MonoidalMap k a -> (MonoidalMap k a, Maybe a, MonoidalMap k a) Source #
splitRoot :: MonoidalMap k a -> [MonoidalMap k a] Source #
toAscList :: MonoidalMap k a -> [(k, a)] Source #
toDescList :: MonoidalMap k a -> [(k, a)] Source #
toList :: MonoidalMap k a -> [(k, a)] Source #
traverseWithKey :: Applicative t => (k -> a -> t b) -> MonoidalMap k a -> t (MonoidalMap k b) Source #
traverseMaybeWithKey :: Applicative f => (k -> a -> f (Maybe b)) -> MonoidalMap k a -> f (MonoidalMap k b) Source #
unionWith :: Ord k => (a -> a -> a) -> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a Source #
unionWithKey :: Ord k => (k -> a -> a -> a) -> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a Source #
unionsWith :: Ord k => (a -> a -> a) -> [MonoidalMap k a] -> MonoidalMap k a Source #
update :: Ord k => (a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a Source #
updateAt :: (k -> a -> Maybe a) -> Int -> MonoidalMap k a -> MonoidalMap k a Source #
updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> MonoidalMap k a -> (Maybe a, MonoidalMap k a) Source #
updateMax :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a Source #
updateMaxWithKey :: (k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a Source #
updateMin :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a Source #
updateMinWithKey :: (k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a Source #
updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a Source #