monus-0.2.0.0: a 'Monus' is a commutative monoid that allows a notion of substraction.

Safe HaskellNone
LanguageHaskell2010

Data.Map.Annihilate

Synopsis

Documentation

data Map k v Source #

A Map that supports annihilation, i.e. it is a Monus, where for Monus values, matching keys will be subtracted, and keys not shared by both Maps will be discarded.

Instances
Functor (Map k) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

fmap :: (a -> b) -> Map k a -> Map k b #

(<$) :: a -> Map k b -> Map k a #

Foldable (Map k) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

fold :: Monoid m => Map k m -> m #

foldMap :: Monoid m => (a -> m) -> Map k a -> m #

foldr :: (a -> b -> b) -> b -> Map k a -> b #

foldr' :: (a -> b -> b) -> b -> Map k a -> b #

foldl :: (b -> a -> b) -> b -> Map k a -> b #

foldl' :: (b -> a -> b) -> b -> Map k a -> b #

foldr1 :: (a -> a -> a) -> Map k a -> a #

foldl1 :: (a -> a -> a) -> Map k a -> a #

toList :: Map k a -> [a] #

null :: Map k a -> Bool #

length :: Map k a -> Int #

elem :: Eq a => a -> Map k a -> Bool #

maximum :: Ord a => Map k a -> a #

minimum :: Ord a => Map k a -> a #

sum :: Num a => Map k a -> a #

product :: Num a => Map k a -> a #

(Eq k, Eq v) => Eq (Map k v) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

(==) :: Map k v -> Map k v -> Bool #

(/=) :: Map k v -> Map k v -> Bool #

(Ord k, Ord v) => Ord (Map k v) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

compare :: Map k v -> Map k v -> Ordering #

(<) :: Map k v -> Map k v -> Bool #

(<=) :: Map k v -> Map k v -> Bool #

(>) :: Map k v -> Map k v -> Bool #

(>=) :: Map k v -> Map k v -> Bool #

max :: Map k v -> Map k v -> Map k v #

min :: Map k v -> Map k v -> Map k v #

(Show k, Show v) => Show (Map k v) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

showsPrec :: Int -> Map k v -> ShowS #

show :: Map k v -> String #

showList :: [Map k v] -> ShowS #

(Ord k, Monoid v, Eq v) => Semigroup (Map k v) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

(<>) :: Map k v -> Map k v -> Map k v #

sconcat :: NonEmpty (Map k v) -> Map k v #

stimes :: Integral b => b -> Map k v -> Map k v #

(Ord k, Monoid v, Eq v) => Monoid (Map k v) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

mconcat :: [Map k v] -> Map k v #

(Ord k, Monus v, Eq v) => Monus (Map k v) Source # 
Instance details

Defined in Data.Map.Annihilate

Methods

monus :: Map k v -> Map k v -> Map k v Source #

singleton :: (Monoid v, Eq v) => k -> v -> Map k v Source #

Create a singleton Map.

lookup :: (Ord k, Monoid v) => k -> Map k v -> v Source #

Lookup a value in a Map. If no value is found, this returns mempty.