monoidal-containers-0.6.3.0: Containers with monoidal accumulation
Safe Haskell None
Language Haskell2010

Data.IntMap.Monoidal.Strict

Description

This module provides a IntMap variant which uses the value's Monoid instance to accumulate conflicting entries when merging Map s.

While some functions mirroring those of IntMap 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

Documentation

newtype MonoidalIntMap a Source #

An IntMap with monoidal accumulation

Instances

Instances details
Functor MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Foldable MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Traversable MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

ToJSON1 MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

FromJSON1 MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Eq1 MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Ord1 MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Show1 MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Semialign MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Align MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Unalign MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Zip MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Filterable MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Witherable MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

FunctorWithIndex Int MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

FoldableWithIndex Int MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Methods

ifoldMap :: Monoid m => ( Int -> a -> m) -> MonoidalIntMap a -> m Source #

ifoldMap' :: Monoid m => ( Int -> a -> m) -> MonoidalIntMap a -> m Source #

ifoldr :: ( Int -> a -> b -> b) -> b -> MonoidalIntMap a -> b Source #

ifoldl :: ( Int -> b -> a -> b) -> b -> MonoidalIntMap a -> b Source #

ifoldr' :: ( Int -> a -> b -> b) -> b -> MonoidalIntMap a -> b Source #

ifoldl' :: ( Int -> b -> a -> b) -> b -> MonoidalIntMap a -> b Source #

TraversableWithIndex Int MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

TraverseMin Int MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

TraverseMax Int MonoidalIntMap Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Semigroup a => IsList ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Associated Types

type Item ( MonoidalIntMap a) Source #

Eq a => Eq ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Data a => Data ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> MonoidalIntMap a -> c ( MonoidalIntMap a) Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ( MonoidalIntMap a) Source #

toConstr :: MonoidalIntMap a -> Constr Source #

dataTypeOf :: MonoidalIntMap a -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ( MonoidalIntMap a)) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ( MonoidalIntMap a)) Source #

gmapT :: ( forall b. Data b => b -> b) -> MonoidalIntMap a -> MonoidalIntMap a Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> MonoidalIntMap a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> MonoidalIntMap a -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> MonoidalIntMap a -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> MonoidalIntMap a -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> MonoidalIntMap a -> m ( MonoidalIntMap a) Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> MonoidalIntMap a -> m ( MonoidalIntMap a) Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> MonoidalIntMap a -> m ( MonoidalIntMap a) Source #

Ord a => Ord ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Read a => Read ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Show a => Show ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Semigroup a => Semigroup ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Semigroup a => Monoid ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

ToJSON a => ToJSON ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

FromJSON a => FromJSON ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

NFData a => NFData ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Ixed ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

At ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Wrapped ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

AsEmpty ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Newtype ( MonoidalIntMap a) ( IntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Each ( MonoidalIntMap a) ( MonoidalIntMap b) a b Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

type Item ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

type Index ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

type IxValue ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

type Unwrapped ( MonoidalIntMap a) Source #
Instance details

Defined in Data.IntMap.Monoidal.Strict

Often-needed functions

singleton :: Int -> a -> MonoidalIntMap a Source #

O(1) . A map with a single element.

size :: MonoidalIntMap a -> Int Source #

O(1) . The number of elements in the map.

member :: Int -> MonoidalIntMap a -> Bool Source #

O(log n) . Is the key a member of the map? See also notMember .

notMember :: Int -> MonoidalIntMap a -> Bool Source #

O(log n) . Is the key not a member of the map? See also member .

findWithDefault :: forall a. a -> Int -> MonoidalIntMap a -> a Source #

O(log n) . The expression ( findWithDefault def k map) returns the value at key k or returns default value def when the key is not in the map.

assocs :: MonoidalIntMap a -> [( Int , a)] Source #

O(n) . Return all elements of the map and their keys

elems :: MonoidalIntMap a -> [a] Source #

O(n) . Return all elements of the map in the ascending order of their keys. Subject to list fusion.

keys :: MonoidalIntMap a -> [ Int ] Source #

O(n) . Return all keys of the map in ascending order. Subject to list fusion.

(!) :: forall a. MonoidalIntMap a -> Int -> a infixl 9 Source #

delete :: Int -> MonoidalIntMap a -> MonoidalIntMap 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.

foldMapWithKey :: forall a m. Monoid m => ( Int -> a -> m) -> MonoidalIntMap a -> m Source #

foldl :: forall a b. (a -> b -> a) -> a -> MonoidalIntMap b -> a Source #

foldl' :: forall a b. (a -> b -> a) -> a -> MonoidalIntMap b -> a Source #

foldlWithKey :: forall a b. (a -> Int -> b -> a) -> a -> MonoidalIntMap b -> a Source #

foldlWithKey' :: forall a b. (a -> Int -> b -> a) -> a -> MonoidalIntMap b -> a Source #

foldr :: forall a b. (a -> b -> b) -> b -> MonoidalIntMap a -> b Source #

foldr' :: forall a b. (a -> b -> b) -> b -> MonoidalIntMap a -> b Source #

foldrWithKey :: forall a b. ( Int -> a -> b -> b) -> b -> MonoidalIntMap a -> b Source #

foldrWithKey' :: forall a b. ( Int -> a -> b -> b) -> b -> MonoidalIntMap a -> b Source #

fromAscListWith :: forall a. (a -> a -> a) -> [( Int , a)] -> MonoidalIntMap a Source #

fromAscListWithKey :: forall a. ( Int -> a -> a -> a) -> [( Int , a)] -> MonoidalIntMap a Source #

fromListWith :: forall a. (a -> a -> a) -> [( Int , a)] -> MonoidalIntMap a Source #

fromListWithKey :: forall a. ( Int -> a -> a -> a) -> [( Int , a)] -> MonoidalIntMap a Source #

insertWith :: forall a. (a -> a -> a) -> Int -> a -> MonoidalIntMap a -> MonoidalIntMap a Source #

mapAccum :: forall a b c. (a -> b -> (a, c)) -> a -> MonoidalIntMap b -> (a, MonoidalIntMap c) Source #

mapAccumRWithKey :: forall a b c. (a -> Int -> b -> (a, c)) -> a -> MonoidalIntMap b -> (a, MonoidalIntMap c) Source #

mapAccumWithKey :: forall a b c. (a -> Int -> b -> (a, c)) -> a -> MonoidalIntMap b -> (a, MonoidalIntMap c) Source #