{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE StandaloneDeriving #-}

-- | This module provides a 'Data.Map' variant which uses the value's
-- 'Monoid' instance to accumulate conflicting entries when merging
-- 'Map's.
--
-- While some functions mirroring those of 'Data.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'.

module Data.Map.Monoidal.Strict
    ( MonoidalMap(..)
      -- * Often-needed functions
    , singleton
    , size
    , member
    , notMember
    , findWithDefault
    , assocs
    , elems
    , keys
    , (!?)
    , (!)
    , (\\)
    , adjust
    , adjustWithKey
    , alter
    , delete
    , deleteAt
    , take
    , drop
    , splitAt
    , lookupMin
    , lookupMax
    , deleteFindMax
    , deleteFindMin
    , deleteMax
    , deleteMin
    , difference
    , differenceWith
    , differenceWithKey
    , elemAt
    , empty
    , filter
    , filterWithKey
    , restrictKeys
    , withoutKeys
    , findIndex
    , findMax
    , findMin
    , foldMapWithKey
    , foldl
    , foldl'
    , foldlWithKey
    , foldlWithKey'
    , foldr
    , foldr'
    , foldrWithKey
    , foldrWithKey'
    , fromAscList
    , fromAscListWith
    , fromAscListWithKey
    , fromDistinctAscList
    , fromDistinctList
    , fromDescList
    , fromDescListWith
    , fromDescListWithKey
    , fromDistinctDescList
    , fromList
    , fromListWith
    , fromListWithKey
    , fromSet
    , insert
    , insertLookupWithKey
    , insertWith
    , insertWithKey
    , intersectionWith
    , intersectionWithKey
    , isProperSubmapOf
    , isProperSubmapOfBy
    , isSubmapOf
    , isSubmapOfBy
    , keysSet
    , lookup
    , lookupGE
    , lookupGT
    , lookupIndex
    , lookupLE
    , lookupLT
    , map
    , mapAccum
    , mapAccumRWithKey
    , mapAccumWithKey
    , mapEither
    , mapEitherWithKey
    , mapKeys
    , mapKeysMonotonic
    , mapKeysWith
    , mapMaybe
    , mapMaybeWithKey
    , mapWithKey
    , maxView
    , maxViewWithKey
    , mergeWithKey
    , minView
    , minViewWithKey
    , null
    , partition
    , partitionWithKey
    , takeWhileAntitone
    , dropWhileAntitone
    , spanAntitone
    , split
    , splitLookup
    , splitRoot
    , toAscList
    , toDescList
    , toList
    , traverseWithKey
    , traverseMaybeWithKey
    , unionWith
    , unionWithKey
    , unionsWith
    , update
    , updateAt
    , updateLookupWithKey
    , updateMax
    , updateMaxWithKey
    , updateMin
    , updateMinWithKey
    , updateWithKey
    , valid
    -- , showTree
    -- , showTreeWith
    ) where

import Prelude hiding (null, lookup, map, foldl, foldr, filter, take, drop, splitAt)

import Data.Coerce (coerce)
import Data.Set (Set)
import Data.Semigroup
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)
import Control.Applicative (Applicative, pure)
import Data.Data (Data)
import Data.Typeable (Typeable)

#if MIN_VERSION_base(4,7,0)
import qualified GHC.Exts as IsList
#endif

import Control.DeepSeq
import qualified Data.Map.Strict as M
import Control.Lens
import Control.Newtype
import Data.Aeson(FromJSON, ToJSON, FromJSON1, ToJSON1)
import Data.Functor.Classes
import Data.Align
#ifdef MIN_VERSION_semialign
import Data.Semialign (Unalign)
#if MIN_VERSION_semialign(1,1,0)
import Data.Zip (Zip)
#endif
#endif
import qualified Witherable

-- | A 'Map' with monoidal accumulation
newtype MonoidalMap k a = MonoidalMap { forall k a. MonoidalMap k a -> Map k a
getMonoidalMap :: M.Map k a }
    deriving ( Int -> MonoidalMap k a -> ShowS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k a. (Show k, Show a) => Int -> MonoidalMap k a -> ShowS
forall k a. (Show k, Show a) => [MonoidalMap k a] -> ShowS
forall k a. (Show k, Show a) => MonoidalMap k a -> String
showList :: [MonoidalMap k a] -> ShowS
$cshowList :: forall k a. (Show k, Show a) => [MonoidalMap k a] -> ShowS
show :: MonoidalMap k a -> String
$cshow :: forall k a. (Show k, Show a) => MonoidalMap k a -> String
showsPrec :: Int -> MonoidalMap k a -> ShowS
$cshowsPrec :: forall k a. (Show k, Show a) => Int -> MonoidalMap k a -> ShowS
Show, ReadPrec [MonoidalMap k a]
ReadPrec (MonoidalMap k a)
ReadS [MonoidalMap k a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall k a. (Ord k, Read k, Read a) => ReadPrec [MonoidalMap k a]
forall k a. (Ord k, Read k, Read a) => ReadPrec (MonoidalMap k a)
forall k a.
(Ord k, Read k, Read a) =>
Int -> ReadS (MonoidalMap k a)
forall k a. (Ord k, Read k, Read a) => ReadS [MonoidalMap k a]
readListPrec :: ReadPrec [MonoidalMap k a]
$creadListPrec :: forall k a. (Ord k, Read k, Read a) => ReadPrec [MonoidalMap k a]
readPrec :: ReadPrec (MonoidalMap k a)
$creadPrec :: forall k a. (Ord k, Read k, Read a) => ReadPrec (MonoidalMap k a)
readList :: ReadS [MonoidalMap k a]
$creadList :: forall k a. (Ord k, Read k, Read a) => ReadS [MonoidalMap k a]
readsPrec :: Int -> ReadS (MonoidalMap k a)
$creadsPrec :: forall k a.
(Ord k, Read k, Read a) =>
Int -> ReadS (MonoidalMap k a)
Read, forall a b. a -> MonoidalMap k b -> MonoidalMap k a
forall a b. (a -> b) -> MonoidalMap k a -> MonoidalMap k b
forall k a b. a -> MonoidalMap k b -> MonoidalMap k a
forall k a b. (a -> b) -> MonoidalMap k a -> MonoidalMap k b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> MonoidalMap k b -> MonoidalMap k a
$c<$ :: forall k a b. a -> MonoidalMap k b -> MonoidalMap k a
fmap :: forall a b. (a -> b) -> MonoidalMap k a -> MonoidalMap k b
$cfmap :: forall k a b. (a -> b) -> MonoidalMap k a -> MonoidalMap k b
Functor, MonoidalMap k a -> MonoidalMap k a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k a.
(Eq k, Eq a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
/= :: MonoidalMap k a -> MonoidalMap k a -> Bool
$c/= :: forall k a.
(Eq k, Eq a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
== :: MonoidalMap k a -> MonoidalMap k a -> Bool
$c== :: forall k a.
(Eq k, Eq a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
Eq, MonoidalMap k a -> MonoidalMap k a -> Bool
MonoidalMap k a -> MonoidalMap k a -> Ordering
MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {k} {a}. (Ord k, Ord a) => Eq (MonoidalMap k a)
forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> Ordering
forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
min :: MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
$cmin :: forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
max :: MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
$cmax :: forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
>= :: MonoidalMap k a -> MonoidalMap k a -> Bool
$c>= :: forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
> :: MonoidalMap k a -> MonoidalMap k a -> Bool
$c> :: forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
<= :: MonoidalMap k a -> MonoidalMap k a -> Bool
$c<= :: forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
< :: MonoidalMap k a -> MonoidalMap k a -> Bool
$c< :: forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
compare :: MonoidalMap k a -> MonoidalMap k a -> Ordering
$ccompare :: forall k a.
(Ord k, Ord a) =>
MonoidalMap k a -> MonoidalMap k a -> Ordering
Ord, MonoidalMap k a -> ()
forall a. (a -> ()) -> NFData a
forall k a. (NFData k, NFData a) => MonoidalMap k a -> ()
rnf :: MonoidalMap k a -> ()
$crnf :: forall k a. (NFData k, NFData a) => MonoidalMap k a -> ()
NFData
             , forall a. Eq a => a -> MonoidalMap k a -> Bool
forall a. Num a => MonoidalMap k a -> a
forall a. Ord a => MonoidalMap k a -> a
forall m. Monoid m => MonoidalMap k m -> m
forall a. MonoidalMap k a -> Bool
forall a. MonoidalMap k a -> Int
forall a. MonoidalMap k a -> [a]
forall a. (a -> a -> a) -> MonoidalMap k a -> a
forall k a. Eq a => a -> MonoidalMap k a -> Bool
forall k a. Num a => MonoidalMap k a -> a
forall k a. Ord a => MonoidalMap k a -> a
forall m a. Monoid m => (a -> m) -> MonoidalMap k a -> m
forall k m. Monoid m => MonoidalMap k m -> m
forall k a. MonoidalMap k a -> Bool
forall k a. MonoidalMap k a -> Int
forall k a. MonoidalMap k a -> [a]
forall b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
forall a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
forall k a. (a -> a -> a) -> MonoidalMap k a -> a
forall k m a. Monoid m => (a -> m) -> MonoidalMap k a -> m
forall k b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => MonoidalMap k a -> a
$cproduct :: forall k a. Num a => MonoidalMap k a -> a
sum :: forall a. Num a => MonoidalMap k a -> a
$csum :: forall k a. Num a => MonoidalMap k a -> a
minimum :: forall a. Ord a => MonoidalMap k a -> a
$cminimum :: forall k a. Ord a => MonoidalMap k a -> a
maximum :: forall a. Ord a => MonoidalMap k a -> a
$cmaximum :: forall k a. Ord a => MonoidalMap k a -> a
elem :: forall a. Eq a => a -> MonoidalMap k a -> Bool
$celem :: forall k a. Eq a => a -> MonoidalMap k a -> Bool
length :: forall a. MonoidalMap k a -> Int
$clength :: forall k a. MonoidalMap k a -> Int
null :: forall a. MonoidalMap k a -> Bool
$cnull :: forall k a. MonoidalMap k a -> Bool
toList :: forall a. MonoidalMap k a -> [a]
$ctoList :: forall k a. MonoidalMap k a -> [a]
foldl1 :: forall a. (a -> a -> a) -> MonoidalMap k a -> a
$cfoldl1 :: forall k a. (a -> a -> a) -> MonoidalMap k a -> a
foldr1 :: forall a. (a -> a -> a) -> MonoidalMap k a -> a
$cfoldr1 :: forall k a. (a -> a -> a) -> MonoidalMap k a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
$cfoldl' :: forall k b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
foldl :: forall b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
$cfoldl :: forall k b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
$cfoldr' :: forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
foldr :: forall a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
$cfoldr :: forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> MonoidalMap k a -> m
$cfoldMap' :: forall k m a. Monoid m => (a -> m) -> MonoidalMap k a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> MonoidalMap k a -> m
$cfoldMap :: forall k m a. Monoid m => (a -> m) -> MonoidalMap k a -> m
fold :: forall m. Monoid m => MonoidalMap k m -> m
$cfold :: forall k m. Monoid m => MonoidalMap k m -> m
Foldable, forall k. Functor (MonoidalMap k)
forall k. Foldable (MonoidalMap k)
forall k (m :: * -> *) a.
Monad m =>
MonoidalMap k (m a) -> m (MonoidalMap k a)
forall k (f :: * -> *) a.
Applicative f =>
MonoidalMap k (f a) -> f (MonoidalMap k a)
forall k (m :: * -> *) a b.
Monad m =>
(a -> m b) -> MonoidalMap k a -> m (MonoidalMap k b)
forall k (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> MonoidalMap k a -> f (MonoidalMap k b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> MonoidalMap k a -> f (MonoidalMap k b)
sequence :: forall (m :: * -> *) a.
Monad m =>
MonoidalMap k (m a) -> m (MonoidalMap k a)
$csequence :: forall k (m :: * -> *) a.
Monad m =>
MonoidalMap k (m a) -> m (MonoidalMap k a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> MonoidalMap k a -> m (MonoidalMap k b)
$cmapM :: forall k (m :: * -> *) a b.
Monad m =>
(a -> m b) -> MonoidalMap k a -> m (MonoidalMap k b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
MonoidalMap k (f a) -> f (MonoidalMap k a)
$csequenceA :: forall k (f :: * -> *) a.
Applicative f =>
MonoidalMap k (f a) -> f (MonoidalMap k a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> MonoidalMap k a -> f (MonoidalMap k b)
$ctraverse :: forall k (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> MonoidalMap k a -> f (MonoidalMap k b)
Traversable
             , Value -> Parser [MonoidalMap k a]
Value -> Parser (MonoidalMap k a)
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
forall k a.
(FromJSONKey k, Ord k, FromJSON a) =>
Value -> Parser [MonoidalMap k a]
forall k a.
(FromJSONKey k, Ord k, FromJSON a) =>
Value -> Parser (MonoidalMap k a)
parseJSONList :: Value -> Parser [MonoidalMap k a]
$cparseJSONList :: forall k a.
(FromJSONKey k, Ord k, FromJSON a) =>
Value -> Parser [MonoidalMap k a]
parseJSON :: Value -> Parser (MonoidalMap k a)
$cparseJSON :: forall k a.
(FromJSONKey k, Ord k, FromJSON a) =>
Value -> Parser (MonoidalMap k a)
FromJSON, [MonoidalMap k a] -> Encoding
[MonoidalMap k a] -> Value
MonoidalMap k a -> Encoding
MonoidalMap k a -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
forall k a.
(ToJSON a, ToJSONKey k) =>
[MonoidalMap k a] -> Encoding
forall k a. (ToJSON a, ToJSONKey k) => [MonoidalMap k a] -> Value
forall k a. (ToJSON a, ToJSONKey k) => MonoidalMap k a -> Encoding
forall k a. (ToJSON a, ToJSONKey k) => MonoidalMap k a -> Value
toEncodingList :: [MonoidalMap k a] -> Encoding
$ctoEncodingList :: forall k a.
(ToJSON a, ToJSONKey k) =>
[MonoidalMap k a] -> Encoding
toJSONList :: [MonoidalMap k a] -> Value
$ctoJSONList :: forall k a. (ToJSON a, ToJSONKey k) => [MonoidalMap k a] -> Value
toEncoding :: MonoidalMap k a -> Encoding
$ctoEncoding :: forall k a. (ToJSON a, ToJSONKey k) => MonoidalMap k a -> Encoding
toJSON :: MonoidalMap k a -> Value
$ctoJSON :: forall k a. (ToJSON a, ToJSONKey k) => MonoidalMap k a -> Value
ToJSON, forall k a.
(FromJSONKey k, Ord k) =>
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser [MonoidalMap k a]
forall k a.
(FromJSONKey k, Ord k) =>
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser (MonoidalMap k a)
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser [MonoidalMap k a]
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser (MonoidalMap k a)
forall (f :: * -> *).
(forall a.
 (Value -> Parser a)
 -> (Value -> Parser [a]) -> Value -> Parser (f a))
-> (forall a.
    (Value -> Parser a)
    -> (Value -> Parser [a]) -> Value -> Parser [f a])
-> FromJSON1 f
liftParseJSONList :: forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser [MonoidalMap k a]
$cliftParseJSONList :: forall k a.
(FromJSONKey k, Ord k) =>
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser [MonoidalMap k a]
liftParseJSON :: forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser (MonoidalMap k a)
$cliftParseJSON :: forall k a.
(FromJSONKey k, Ord k) =>
(Value -> Parser a)
-> (Value -> Parser [a]) -> Value -> Parser (MonoidalMap k a)
FromJSON1, forall k a.
ToJSONKey k =>
(a -> Encoding)
-> ([a] -> Encoding) -> [MonoidalMap k a] -> Encoding
forall k a.
ToJSONKey k =>
(a -> Encoding) -> ([a] -> Encoding) -> MonoidalMap k a -> Encoding
forall k a.
ToJSONKey k =>
(a -> Value) -> ([a] -> Value) -> [MonoidalMap k a] -> Value
forall k a.
ToJSONKey k =>
(a -> Value) -> ([a] -> Value) -> MonoidalMap k a -> Value
forall a.
(a -> Encoding)
-> ([a] -> Encoding) -> [MonoidalMap k a] -> Encoding
forall a.
(a -> Encoding) -> ([a] -> Encoding) -> MonoidalMap k a -> Encoding
forall a.
(a -> Value) -> ([a] -> Value) -> [MonoidalMap k a] -> Value
forall a.
(a -> Value) -> ([a] -> Value) -> MonoidalMap k a -> Value
forall (f :: * -> *).
(forall a. (a -> Value) -> ([a] -> Value) -> f a -> Value)
-> (forall a. (a -> Value) -> ([a] -> Value) -> [f a] -> Value)
-> (forall a.
    (a -> Encoding) -> ([a] -> Encoding) -> f a -> Encoding)
-> (forall a.
    (a -> Encoding) -> ([a] -> Encoding) -> [f a] -> Encoding)
-> ToJSON1 f
liftToEncodingList :: forall a.
(a -> Encoding)
-> ([a] -> Encoding) -> [MonoidalMap k a] -> Encoding
$cliftToEncodingList :: forall k a.
ToJSONKey k =>
(a -> Encoding)
-> ([a] -> Encoding) -> [MonoidalMap k a] -> Encoding
liftToEncoding :: forall a.
(a -> Encoding) -> ([a] -> Encoding) -> MonoidalMap k a -> Encoding
$cliftToEncoding :: forall k a.
ToJSONKey k =>
(a -> Encoding) -> ([a] -> Encoding) -> MonoidalMap k a -> Encoding
liftToJSONList :: forall a.
(a -> Value) -> ([a] -> Value) -> [MonoidalMap k a] -> Value
$cliftToJSONList :: forall k a.
ToJSONKey k =>
(a -> Value) -> ([a] -> Value) -> [MonoidalMap k a] -> Value
liftToJSON :: forall a.
(a -> Value) -> ([a] -> Value) -> MonoidalMap k a -> Value
$cliftToJSON :: forall k a.
ToJSONKey k =>
(a -> Value) -> ([a] -> Value) -> MonoidalMap k a -> Value
ToJSON1
             , MonoidalMap k a -> DataType
MonoidalMap k a -> Constr
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall {k} {a}.
(Data k, Data a, Ord k) =>
Typeable (MonoidalMap k a)
forall k a. (Data k, Data a, Ord k) => MonoidalMap k a -> DataType
forall k a. (Data k, Data a, Ord k) => MonoidalMap k a -> Constr
forall k a.
(Data k, Data a, Ord k) =>
(forall b. Data b => b -> b) -> MonoidalMap k a -> MonoidalMap k a
forall k a u.
(Data k, Data a, Ord k) =>
Int -> (forall d. Data d => d -> u) -> MonoidalMap k a -> u
forall k a u.
(Data k, Data a, Ord k) =>
(forall d. Data d => d -> u) -> MonoidalMap k a -> [u]
forall k a r r'.
(Data k, Data a, Ord k) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MonoidalMap k a -> r
forall k a r r'.
(Data k, Data a, Ord k) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MonoidalMap k a -> r
forall k a (m :: * -> *).
(Data k, Data a, Ord k, Monad m) =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
forall k a (m :: * -> *).
(Data k, Data a, Ord k, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
forall k a (c :: * -> *).
(Data k, Data a, Ord k) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MonoidalMap k a)
forall k a (c :: * -> *).
(Data k, Data a, Ord k) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MonoidalMap k a -> c (MonoidalMap k a)
forall k a (t :: * -> *) (c :: * -> *).
(Data k, Data a, Ord k, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MonoidalMap k a))
forall k a (t :: * -> * -> *) (c :: * -> *).
(Data k, Data a, Ord k, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MonoidalMap k a))
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MonoidalMap k a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MonoidalMap k a -> c (MonoidalMap k a)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MonoidalMap k a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
$cgmapMo :: forall k a (m :: * -> *).
(Data k, Data a, Ord k, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
$cgmapMp :: forall k a (m :: * -> *).
(Data k, Data a, Ord k, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
$cgmapM :: forall k a (m :: * -> *).
(Data k, Data a, Ord k, Monad m) =>
(forall d. Data d => d -> m d)
-> MonoidalMap k a -> m (MonoidalMap k a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> MonoidalMap k a -> u
$cgmapQi :: forall k a u.
(Data k, Data a, Ord k) =>
Int -> (forall d. Data d => d -> u) -> MonoidalMap k a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> MonoidalMap k a -> [u]
$cgmapQ :: forall k a u.
(Data k, Data a, Ord k) =>
(forall d. Data d => d -> u) -> MonoidalMap k a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MonoidalMap k a -> r
$cgmapQr :: forall k a r r'.
(Data k, Data a, Ord k) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MonoidalMap k a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MonoidalMap k a -> r
$cgmapQl :: forall k a r r'.
(Data k, Data a, Ord k) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MonoidalMap k a -> r
gmapT :: (forall b. Data b => b -> b) -> MonoidalMap k a -> MonoidalMap k a
$cgmapT :: forall k a.
(Data k, Data a, Ord k) =>
(forall b. Data b => b -> b) -> MonoidalMap k a -> MonoidalMap k a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MonoidalMap k a))
$cdataCast2 :: forall k a (t :: * -> * -> *) (c :: * -> *).
(Data k, Data a, Ord k, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MonoidalMap k a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MonoidalMap k a))
$cdataCast1 :: forall k a (t :: * -> *) (c :: * -> *).
(Data k, Data a, Ord k, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MonoidalMap k a))
dataTypeOf :: MonoidalMap k a -> DataType
$cdataTypeOf :: forall k a. (Data k, Data a, Ord k) => MonoidalMap k a -> DataType
toConstr :: MonoidalMap k a -> Constr
$ctoConstr :: forall k a. (Data k, Data a, Ord k) => MonoidalMap k a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MonoidalMap k a)
$cgunfold :: forall k a (c :: * -> *).
(Data k, Data a, Ord k) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MonoidalMap k a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MonoidalMap k a -> c (MonoidalMap k a)
$cgfoldl :: forall k a (c :: * -> *).
(Data k, Data a, Ord k) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MonoidalMap k a -> c (MonoidalMap k a)
Data, Typeable, forall a. MonoidalMap k a
forall {k}. Ord k => Semialign (MonoidalMap k)
forall k a. Ord k => MonoidalMap k a
forall (f :: * -> *). Semialign f -> (forall a. f a) -> Align f
nil :: forall a. MonoidalMap k a
$cnil :: forall k a. Ord k => MonoidalMap k a
Align
#if MIN_VERSION_these(0,8,0)
             , forall {k}. Ord k => Functor (MonoidalMap k)
forall k a b.
Ord k =>
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (These a b)
forall k a b c.
Ord k =>
(These a b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
forall a b.
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (These a b)
forall a b c.
(These a b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
forall (f :: * -> *).
Functor f
-> (forall a b. f a -> f b -> f (These a b))
-> (forall a b c. (These a b -> c) -> f a -> f b -> f c)
-> Semialign f
alignWith :: forall a b c.
(These a b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
$calignWith :: forall k a b c.
Ord k =>
(These a b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
align :: forall a b.
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (These a b)
$calign :: forall k a b.
Ord k =>
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (These a b)
Semialign
#endif
#ifdef MIN_VERSION_semialign
             , forall {k}. Ord k => Semialign (MonoidalMap k)
forall k a b.
Ord k =>
MonoidalMap k (These a b) -> (MonoidalMap k a, MonoidalMap k b)
forall k c a b.
Ord k =>
(c -> These a b)
-> MonoidalMap k c -> (MonoidalMap k a, MonoidalMap k b)
forall a b.
MonoidalMap k (These a b) -> (MonoidalMap k a, MonoidalMap k b)
forall c a b.
(c -> These a b)
-> MonoidalMap k c -> (MonoidalMap k a, MonoidalMap k b)
forall (f :: * -> *).
Semialign f
-> (forall a b. f (These a b) -> (f a, f b))
-> (forall c a b. (c -> These a b) -> f c -> (f a, f b))
-> Unalign f
unalignWith :: forall c a b.
(c -> These a b)
-> MonoidalMap k c -> (MonoidalMap k a, MonoidalMap k b)
$cunalignWith :: forall k c a b.
Ord k =>
(c -> These a b)
-> MonoidalMap k c -> (MonoidalMap k a, MonoidalMap k b)
unalign :: forall a b.
MonoidalMap k (These a b) -> (MonoidalMap k a, MonoidalMap k b)
$cunalign :: forall k a b.
Ord k =>
MonoidalMap k (These a b) -> (MonoidalMap k a, MonoidalMap k b)
Unalign
#if MIN_VERSION_semialign(1,1,0)
             , forall {k}. Ord k => Semialign (MonoidalMap k)
forall k a b.
Ord k =>
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (a, b)
forall k a b c.
Ord k =>
(a -> b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
forall a b.
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (a, b)
forall a b c.
(a -> b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
forall (f :: * -> *).
Semialign f
-> (forall a b. f a -> f b -> f (a, b))
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> Zip f
zipWith :: forall a b c.
(a -> b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
$czipWith :: forall k a b c.
Ord k =>
(a -> b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
zip :: forall a b.
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (a, b)
$czip :: forall k a b.
Ord k =>
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k (a, b)
Zip
#endif
#endif
             , forall k. Functor (MonoidalMap k)
forall a. MonoidalMap k (Maybe a) -> MonoidalMap k a
forall a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
forall k a. MonoidalMap k (Maybe a) -> MonoidalMap k a
forall a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
forall k a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
forall (f :: * -> *).
Functor f
-> (forall a b. (a -> Maybe b) -> f a -> f b)
-> (forall a. f (Maybe a) -> f a)
-> (forall a. (a -> Bool) -> f a -> f a)
-> Filterable f
filter :: forall a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
$cfilter :: forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
catMaybes :: forall a. MonoidalMap k (Maybe a) -> MonoidalMap k a
$ccatMaybes :: forall k a. MonoidalMap k (Maybe a) -> MonoidalMap k a
mapMaybe :: forall a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
$cmapMaybe :: forall k a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
Witherable.Filterable
             )

deriving instance (Ord k) => Eq1 (MonoidalMap k)
deriving instance (Ord k) => Ord1 (MonoidalMap k)
deriving instance (Show k) => Show1 (MonoidalMap k)

type instance Index (MonoidalMap k a) = k
type instance IxValue (MonoidalMap k a) = a
instance Ord k => Ixed (MonoidalMap k a) where
    ix :: Index (MonoidalMap k a)
-> Traversal' (MonoidalMap k a) (IxValue (MonoidalMap k a))
ix Index (MonoidalMap k a)
k IxValue (MonoidalMap k a) -> f (IxValue (MonoidalMap k a))
f (MonoidalMap Map k a
m) = case forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Index (MonoidalMap k a)
k Map k a
m of
      Just a
v  -> IxValue (MonoidalMap k a) -> f (IxValue (MonoidalMap k a))
f a
v forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \a
v' -> forall k a. Map k a -> MonoidalMap k a
MonoidalMap (forall k a. Ord k => k -> a -> Map k a -> Map k a
M.insert Index (MonoidalMap k a)
k a
v' Map k a
m)
      Maybe a
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure (forall k a. Map k a -> MonoidalMap k a
MonoidalMap Map k a
m)
    {-# INLINE ix #-}

instance Ord k => At (MonoidalMap k a) where
    at :: Index (MonoidalMap k a)
-> Lens' (MonoidalMap k a) (Maybe (IxValue (MonoidalMap k a)))
at Index (MonoidalMap k a)
k Maybe (IxValue (MonoidalMap k a))
-> f (Maybe (IxValue (MonoidalMap k a)))
f (MonoidalMap Map k a
m) = Maybe (IxValue (MonoidalMap k a))
-> f (Maybe (IxValue (MonoidalMap k a)))
f Maybe a
mv forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \Maybe a
r -> case Maybe a
r of
      Maybe a
Nothing -> forall b a. b -> (a -> b) -> Maybe a -> b
maybe (forall k a. Map k a -> MonoidalMap k a
MonoidalMap Map k a
m) (forall a b. a -> b -> a
const (forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a b. (a -> b) -> a -> b
$ forall k a. Ord k => k -> Map k a -> Map k a
M.delete Index (MonoidalMap k a)
k Map k a
m)) Maybe a
mv
      Just a
v' -> forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a b. (a -> b) -> a -> b
$ forall k a. Ord k => k -> a -> Map k a -> Map k a
M.insert Index (MonoidalMap k a)
k a
v' Map k a
m
      where mv :: Maybe a
mv = forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Index (MonoidalMap k a)
k Map k a
m
    {-# INLINE at #-}

instance Each (MonoidalMap k a) (MonoidalMap k b) a b

instance FunctorWithIndex k (MonoidalMap k)
instance FoldableWithIndex k (MonoidalMap k)
instance TraversableWithIndex k (MonoidalMap k) where
    itraverse :: forall (f :: * -> *) a b.
Applicative f =>
(k -> a -> f b) -> MonoidalMap k a -> f (MonoidalMap k b)
itraverse k -> a -> f b
f (MonoidalMap Map k a
m) = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a b. (a -> b) -> a -> b
$ forall i (t :: * -> *) (f :: * -> *) a b.
(TraversableWithIndex i t, Applicative f) =>
(i -> a -> f b) -> t a -> f (t b)
itraverse k -> a -> f b
f Map k a
m
    {-# INLINE itraverse #-}

instance Ord k => TraverseMin k (MonoidalMap k) where
    traverseMin :: forall v. IndexedTraversal' k (MonoidalMap k v) v
traverseMin p v (f v)
f (MonoidalMap Map k v
m) = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a b. (a -> b) -> a -> b
$ forall k (m :: * -> *) v.
TraverseMin k m =>
IndexedTraversal' k (m v) v
traverseMin p v (f v)
f Map k v
m
    {-# INLINE traverseMin #-}
instance Ord k => TraverseMax k (MonoidalMap k) where
    traverseMax :: forall v. IndexedTraversal' k (MonoidalMap k v) v
traverseMax p v (f v)
f (MonoidalMap Map k v
m) = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a b. (a -> b) -> a -> b
$ forall k (m :: * -> *) v.
TraverseMax k m =>
IndexedTraversal' k (m v) v
traverseMax p v (f v)
f Map k v
m
    {-# INLINE traverseMax #-}

instance AsEmpty (MonoidalMap k a) where
    _Empty :: Prism' (MonoidalMap k a) ()
_Empty = forall a. a -> (a -> Bool) -> Prism' a ()
nearly (forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall k a. Map k a
M.empty) (forall k a. Map k a -> Bool
M.null forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack)
    {-# INLINE _Empty #-}

instance Wrapped (MonoidalMap k a) where
    type Unwrapped (MonoidalMap k a) = M.Map k a
    _Wrapped' :: Iso' (MonoidalMap k a) (Unwrapped (MonoidalMap k a))
_Wrapped' = forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
iso forall n o. Newtype n o => n -> o
unpack forall n o. Newtype n o => o -> n
pack
    {-# INLINE _Wrapped' #-}

instance Ord k => Rewrapped (M.Map k a) (MonoidalMap k a)

instance Ord k => Rewrapped (MonoidalMap k a) (M.Map k a)

instance (Ord k, Semigroup a) => Semigroup (MonoidalMap k a) where
    MonoidalMap Map k a
a <> :: MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
<> MonoidalMap Map k a
b = forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a b. (a -> b) -> a -> b
$ forall k a. Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a
M.unionWith forall a. Semigroup a => a -> a -> a
(<>) Map k a
a Map k a
b
    {-# INLINE (<>) #-}

instance (Ord k, Semigroup a) => Monoid (MonoidalMap k a) where
    mempty :: MonoidalMap k a
mempty = forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a. Monoid a => a
mempty
    {-# INLINE mempty #-}
#if !(MIN_VERSION_base(4,11,0))
    mappend (MonoidalMap a) (MonoidalMap b) = MonoidalMap $ M.unionWith (<>) a b
    {-# INLINE mappend #-}
#endif

instance Newtype (MonoidalMap k a) (M.Map k a) where
    pack :: Map k a -> MonoidalMap k a
pack = forall k a. Map k a -> MonoidalMap k a
MonoidalMap
    {-# INLINE pack #-}
    unpack :: MonoidalMap k a -> Map k a
unpack (MonoidalMap Map k a
a) = Map k a
a
    {-# INLINE unpack #-}

#if MIN_VERSION_base(4,7,0)
instance (Ord k, Semigroup a) => IsList.IsList (MonoidalMap k a) where
    type Item (MonoidalMap k a) = (k, a)
    fromList :: [Item (MonoidalMap k a)] -> MonoidalMap k a
fromList = forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
M.fromListWith forall a. Semigroup a => a -> a -> a
(<>)
    {-# INLINE fromList #-}
    toList :: MonoidalMap k a -> [Item (MonoidalMap k a)]
toList = forall k a. Map k a -> [(k, a)]
M.toList forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
    {-# INLINE toList #-}
#endif

instance Ord k => Witherable.Witherable (MonoidalMap k)

-- | /O(1)/. A map with a single element.
singleton :: k -> a -> MonoidalMap k a
singleton :: forall k a. k -> a -> MonoidalMap k a
singleton k
k a
a = forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall a b. (a -> b) -> a -> b
$ forall k a. k -> a -> Map k a
M.singleton k
k a
a
{-# INLINE singleton #-}

-- | /O(1)/. The number of elements in the map.
size :: MonoidalMap k a -> Int
size :: forall k a. MonoidalMap k a -> Int
size = forall k a. Map k a -> Int
M.size forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
{-# INLINE size #-}

-- | /O(log n)/. Is the key a member of the map? See also 'notMember'.
member :: Ord k => k -> MonoidalMap k a -> Bool
member :: forall k a. Ord k => k -> MonoidalMap k a -> Bool
member k
k = forall k a. Ord k => k -> Map k a -> Bool
M.member k
k forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
{-# INLINE member #-}

-- | /O(log n)/. Is the key not a member of the map? See also 'member'.
notMember :: Ord k => k -> MonoidalMap k a -> Bool
notMember :: forall k a. Ord k => k -> MonoidalMap k a -> Bool
notMember k
k = Bool -> Bool
not forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => k -> Map k a -> Bool
M.member k
k forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
{-# INLINE notMember #-}

-- | /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.
findWithDefault :: Ord k => a -> k -> MonoidalMap k a -> a
findWithDefault :: forall k a. Ord k => a -> k -> MonoidalMap k a -> a
findWithDefault a
def k
k = forall k a. Ord k => a -> k -> Map k a -> a
M.findWithDefault a
def k
k forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
{-# INLINE findWithDefault #-}

-- | /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.
delete :: Ord k => k -> MonoidalMap k a -> MonoidalMap k a
delete :: forall k a. Ord k => k -> MonoidalMap k a -> MonoidalMap k a
delete k
k = forall s. Wrapped s => (Unwrapped s -> s) -> Iso' s (Unwrapped s)
_Wrapping' forall k a. Map k a -> MonoidalMap k a
MonoidalMap forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ forall k a. Ord k => k -> Map k a -> Map k a
M.delete k
k
{-# INLINE delete #-}

-- | /O(n)/. Return all elements of the map and their keys
assocs :: MonoidalMap k a -> [(k,a)]
assocs :: forall k a. MonoidalMap k a -> [(k, a)]
assocs = forall k a. Map k a -> [(k, a)]
M.assocs forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
{-# INLINE assocs #-}

-- | /O(n)/. Return all elements of the map in the ascending order of their
-- keys. Subject to list fusion.
elems :: MonoidalMap k a -> [a]
elems :: forall k a. MonoidalMap k a -> [a]
elems = forall k a. Map k a -> [a]
M.elems forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
{-# INLINE elems #-}

-- | /O(n)/. Return all keys of the map in ascending order. Subject to list
-- fusion.
keys :: MonoidalMap k a -> [k]
keys :: forall k a. MonoidalMap k a -> [k]
keys = forall k a. Map k a -> [k]
M.keys forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n o. Newtype n o => n -> o
unpack
{-# INLINE keys #-}

(!?) :: forall k a. Ord k => MonoidalMap k a -> k -> Maybe a
!? :: forall k a. Ord k => MonoidalMap k a -> k -> Maybe a
(!?) = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => Map k a -> k -> Maybe a
(M.!?) :: M.Map k a -> k -> Maybe a)
infixl 9 !?
{-# INLINE (!?) #-}

(!) :: forall k a. Ord k => MonoidalMap k a -> k -> a
! :: forall k a. Ord k => MonoidalMap k a -> k -> a
(!) = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => Map k a -> k -> a
(M.!) :: M.Map k a -> k -> a)
infixl 9 !

(\\) :: forall k a b. Ord k => MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
\\ :: forall k a b.
Ord k =>
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
(\\) = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b. Ord k => Map k a -> Map k b -> Map k a
(M.\\) :: M.Map k a -> M.Map k b -> M.Map k a)
infixl 9 \\ --

null :: forall k a. MonoidalMap k a -> Bool
null :: forall k a. MonoidalMap k a -> Bool
null = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Bool
M.null :: M.Map k a -> Bool)
{-# INLINE null #-}

lookup :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe a
lookup :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe a
lookup = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup :: k -> M.Map k a -> Maybe a)
{-# INLINE lookup #-}

lookupLT :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupLT :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupLT = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k v. Ord k => k -> Map k v -> Maybe (k, v)
M.lookupLT :: k -> M.Map k a -> Maybe (k,a))
{-# INLINE lookupLT #-}

lookupGT :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupGT :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupGT = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k v. Ord k => k -> Map k v -> Maybe (k, v)
M.lookupGT :: k -> M.Map k a -> Maybe (k,a))
{-# INLINE lookupGT #-}

lookupLE :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupLE :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupLE = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k v. Ord k => k -> Map k v -> Maybe (k, v)
M.lookupLE :: k -> M.Map k a -> Maybe (k,a))
{-# INLINE lookupLE #-}

lookupGE :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupGE :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe (k, a)
lookupGE = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k v. Ord k => k -> Map k v -> Maybe (k, v)
M.lookupGE :: k -> M.Map k a -> Maybe (k,a))
{-# INLINE lookupGE #-}

empty :: forall k a. MonoidalMap k a
empty :: forall k a. MonoidalMap k a
empty = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a
M.empty :: M.Map k a)
{-# INLINE empty #-}

insert :: forall k a. Ord k => k -> a -> MonoidalMap k a -> MonoidalMap k a
insert :: forall k a. Ord k => k -> a -> MonoidalMap k a -> MonoidalMap k a
insert = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => k -> a -> Map k a -> Map k a
M.insert :: k -> a -> M.Map k a -> M.Map k a)
{-# INLINE insert #-}

insertWith :: forall k a. Ord k => (a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a
insertWith :: forall k a.
Ord k =>
(a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a
insertWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a
M.insertWith :: (a -> a -> a) -> k -> a -> M.Map k a -> M.Map k a)
{-# INLINE insertWith #-}

insertWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a
insertWithKey :: forall k a.
Ord k =>
(k -> a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a
insertWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a.
Ord k =>
(k -> a -> a -> a) -> k -> a -> Map k a -> Map k a
M.insertWithKey :: (k -> a -> a -> a) -> k -> a -> M.Map k a -> M.Map k a)
{-# INLINE insertWithKey #-}

insertLookupWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> k -> a -> MonoidalMap k a -> (Maybe a, MonoidalMap k a)
insertLookupWithKey :: forall k a.
Ord k =>
(k -> a -> a -> a)
-> k -> a -> MonoidalMap k a -> (Maybe a, MonoidalMap k a)
insertLookupWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a.
Ord k =>
(k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a)
M.insertLookupWithKey :: (k -> a -> a -> a) -> k -> a -> M.Map k a -> (Maybe a, M.Map k a))
{-# INLINE insertLookupWithKey #-}

adjust :: forall k a. Ord k => (a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a
adjust :: forall k a.
Ord k =>
(a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a
adjust = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (a -> a) -> k -> Map k a -> Map k a
M.adjust :: (a -> a) -> k -> M.Map k a -> M.Map k a)
{-# INLINE adjust #-}

adjustWithKey :: forall k a. Ord k => (k -> a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a
adjustWithKey :: forall k a.
Ord k =>
(k -> a -> a) -> k -> MonoidalMap k a -> MonoidalMap k a
adjustWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (k -> a -> a) -> k -> Map k a -> Map k a
M.adjustWithKey :: (k -> a -> a) -> k -> M.Map k a -> M.Map k a)
{-# INLINE adjustWithKey #-}

update :: forall k a. Ord k => (a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
update :: forall k a.
Ord k =>
(a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
update = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a
M.update :: (a -> Maybe a) -> k -> M.Map k a -> M.Map k a)
{-# INLINE update #-}

updateWithKey :: forall k a. Ord k => (k -> a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
updateWithKey :: forall k a.
Ord k =>
(k -> a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
updateWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a
M.updateWithKey :: (k -> a -> Maybe a) -> k -> M.Map k a -> M.Map k a)
{-# INLINE updateWithKey #-}

updateLookupWithKey :: forall k a. Ord k => (k -> a -> Maybe a) -> k -> MonoidalMap k a -> (Maybe a, MonoidalMap k a)
updateLookupWithKey :: forall k a.
Ord k =>
(k -> a -> Maybe a)
-> k -> MonoidalMap k a -> (Maybe a, MonoidalMap k a)
updateLookupWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a.
Ord k =>
(k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a)
M.updateLookupWithKey :: (k -> a -> Maybe a) -> k -> M.Map k a -> (Maybe a, M.Map k a))
{-# INLINE updateLookupWithKey #-}

alter :: forall k a. Ord k => (Maybe a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
alter :: forall k a.
Ord k =>
(Maybe a -> Maybe a) -> k -> MonoidalMap k a -> MonoidalMap k a
alter = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a.
Ord k =>
(Maybe a -> Maybe a) -> k -> Map k a -> Map k a
M.alter :: (Maybe a -> Maybe a) -> k -> M.Map k a -> M.Map k a)
{-# INLINE alter #-}

unionWith :: forall k a. Ord k => (a -> a -> a) -> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
unionWith :: forall k a.
Ord k =>
(a -> a -> a)
-> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
unionWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a
M.unionWith :: (a -> a -> a) -> M.Map k a -> M.Map k a -> M.Map k a)
{-# INLINE unionWith #-}

unionWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
unionWithKey :: forall k a.
Ord k =>
(k -> a -> a -> a)
-> MonoidalMap k a -> MonoidalMap k a -> MonoidalMap k a
unionWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a.
Ord k =>
(k -> a -> a -> a) -> Map k a -> Map k a -> Map k a
M.unionWithKey :: (k -> a -> a -> a) -> M.Map k a -> M.Map k a -> M.Map k a)
{-# INLINE unionWithKey #-}

unionsWith :: forall k a. Ord k => (a -> a -> a) -> [MonoidalMap k a] -> MonoidalMap k a
unionsWith :: forall k a.
Ord k =>
(a -> a -> a) -> [MonoidalMap k a] -> MonoidalMap k a
unionsWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (f :: * -> *) k a.
(Foldable f, Ord k) =>
(a -> a -> a) -> f (Map k a) -> Map k a
M.unionsWith :: (a -> a -> a) -> [M.Map k a] -> M.Map k a)
{-# INLINE unionsWith #-}

difference :: forall k a b. Ord k => MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
difference :: forall k a b.
Ord k =>
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
difference = forall k a b.
Ord k =>
MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
(\\)
{-# INLINE difference #-}

differenceWith :: forall k a b. Ord k => (a -> b -> Maybe a) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
differenceWith :: forall k a b.
Ord k =>
(a -> b -> Maybe a)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
differenceWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b.
Ord k =>
(a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a
M.differenceWith :: (a -> b -> Maybe a) -> M.Map k a -> M.Map k b -> M.Map k a)
{-# INLINE differenceWith #-}

differenceWithKey :: forall k a b. Ord k => (k -> a -> b -> Maybe a) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
differenceWithKey :: forall k a b.
Ord k =>
(k -> a -> b -> Maybe a)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k a
differenceWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b.
Ord k =>
(k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a
M.differenceWithKey :: (k -> a -> b -> Maybe a) -> M.Map k a -> M.Map k b -> M.Map k a)
{-# INLINE differenceWithKey #-}

intersectionWith :: forall k a b c. Ord k => (a -> b -> c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
intersectionWith :: forall k a b c.
Ord k =>
(a -> b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
intersectionWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b c.
Ord k =>
(a -> b -> c) -> Map k a -> Map k b -> Map k c
M.intersectionWith :: (a -> b -> c) -> M.Map k a -> M.Map k b -> M.Map k c)
{-# INLINE intersectionWith #-}

intersectionWithKey :: forall k a b c. Ord k => (k -> a -> b -> c) -> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
intersectionWithKey :: forall k a b c.
Ord k =>
(k -> a -> b -> c)
-> MonoidalMap k a -> MonoidalMap k b -> MonoidalMap k c
intersectionWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b c.
Ord k =>
(k -> a -> b -> c) -> Map k a -> Map k b -> Map k c
M.intersectionWithKey :: (k -> a -> b -> c) -> M.Map k a -> M.Map k b -> M.Map k c)
{-# INLINE intersectionWithKey #-}

mergeWithKey :: forall k a b c. 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
mergeWithKey :: forall k a b c.
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
mergeWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b c.
Ord k =>
(k -> a -> b -> Maybe c)
-> (Map k a -> Map k c)
-> (Map k b -> Map k c)
-> Map k a
-> Map k b
-> Map k c
M.mergeWithKey :: (k -> a -> b -> Maybe c) -> (M.Map k a -> M.Map k c) -> (M.Map k b -> M.Map k c) -> M.Map k a -> M.Map k b -> M.Map k c)
{-# INLINE mergeWithKey #-}

map :: (a -> b) -> MonoidalMap k a -> MonoidalMap k b
map :: forall a b k. (a -> b) -> MonoidalMap k a -> MonoidalMap k b
map = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
{-# INLINE map #-}

mapWithKey :: forall k a  b. (k -> a -> b) -> MonoidalMap k a -> MonoidalMap k b
mapWithKey :: forall k a b. (k -> a -> b) -> MonoidalMap k a -> MonoidalMap k b
mapWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b. (k -> a -> b) -> Map k a -> Map k b
M.mapWithKey :: (k -> a -> b) -> M.Map k a -> M.Map k b)
{-# INLINE mapWithKey #-}

traverseWithKey :: Applicative t => (k -> a -> t b) -> MonoidalMap k a -> t (MonoidalMap k b)
traverseWithKey :: forall (t :: * -> *) k a b.
Applicative t =>
(k -> a -> t b) -> MonoidalMap k a -> t (MonoidalMap k b)
traverseWithKey = forall i (t :: * -> *) (f :: * -> *) a b.
(TraversableWithIndex i t, Applicative f) =>
(i -> a -> f b) -> t a -> f (t b)
itraverse
{-# INLINE traverseWithKey #-}

traverseMaybeWithKey :: forall f k a b. Applicative f => (k -> a -> f (Maybe b)) -> MonoidalMap k a -> f (MonoidalMap k b)
traverseMaybeWithKey :: forall (f :: * -> *) k a b.
Applicative f =>
(k -> a -> f (Maybe b)) -> MonoidalMap k a -> f (MonoidalMap k b)
traverseMaybeWithKey k -> a -> f (Maybe b)
f MonoidalMap k a
m = coerce :: forall a b. Coercible a b => a -> b
coerce forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (f :: * -> *) k a b.
Applicative f =>
(k -> a -> f (Maybe b)) -> Map k a -> f (Map k b)
M.traverseMaybeWithKey k -> a -> f (Maybe b)
f (coerce :: forall a b. Coercible a b => a -> b
coerce MonoidalMap k a
m)
{-# INLINE traverseMaybeWithKey #-}

mapAccum :: forall k a b c. (a -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c)
mapAccum :: forall k a b c.
(a -> b -> (a, c)) -> a -> MonoidalMap k b -> (a, MonoidalMap k c)
mapAccum = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a b c k. (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)
M.mapAccum :: (a -> b -> (a, c)) -> a -> M.Map k b -> (a, M.Map k c))
{-# INLINE mapAccum #-}

mapAccumWithKey :: 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)
mapAccumWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k b c.
(a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)
M.mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> M.Map k b -> (a, M.Map k c))
{-# INLINE mapAccumWithKey #-}

mapAccumRWithKey :: forall k a b c. (a -> k -> 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)
mapAccumRWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k b c.
(a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)
M.mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> M.Map k b -> (a, M.Map k c))
{-# INLINE mapAccumRWithKey #-}

mapKeys :: forall k1 k2 a. Ord k2 => (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a
mapKeys :: forall k1 k2 a.
Ord k2 =>
(k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a
mapKeys = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k2 k1 a. Ord k2 => (k1 -> k2) -> Map k1 a -> Map k2 a
M.mapKeys :: (k1 -> k2) -> M.Map k1 a -> M.Map k2 a)
{-# INLINE mapKeys #-}

mapKeysWith :: forall k1 k2 a. Ord k2 => (a -> a -> a) -> (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
mapKeysWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k2 a k1.
Ord k2 =>
(a -> a -> a) -> (k1 -> k2) -> Map k1 a -> Map k2 a
M.mapKeysWith :: (a -> a -> a) -> (k1 -> k2) -> M.Map k1 a -> M.Map k2 a)
{-# INLINE mapKeysWith #-}

-- | /O(n)/.
-- @'mapKeysMonotonic' f s == 'mapKeys' f s@, but works only when @f@
-- 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
mapKeysMonotonic :: forall k1 k2 a. (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a
mapKeysMonotonic :: forall k1 k2 a. (k1 -> k2) -> MonoidalMap k1 a -> MonoidalMap k2 a
mapKeysMonotonic = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k1 k2 a. (k1 -> k2) -> Map k1 a -> Map k2 a
M.mapKeysMonotonic :: (k1 -> k2) -> M.Map k1 a -> M.Map k2 a)
{-# INLINE mapKeysMonotonic #-}

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
foldr = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a b k. (a -> b -> b) -> b -> Map k a -> b
M.foldr :: (a -> b -> b) -> b -> M.Map k a -> b)
{-# INLINE foldr #-}

foldl :: forall k a b. (a -> b -> a) -> a -> MonoidalMap k b -> a
foldl :: forall k b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
foldl = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a b k. (a -> b -> a) -> a -> Map k b -> a
M.foldl :: (a -> b -> a) -> a -> M.Map k b -> a)
{-# INLINE foldl #-}

foldrWithKey :: forall k a b. (k -> a -> b -> b) -> b -> MonoidalMap k a -> b
foldrWithKey :: forall k a b. (k -> a -> b -> b) -> b -> MonoidalMap k a -> b
foldrWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b. (k -> a -> b -> b) -> b -> Map k a -> b
M.foldrWithKey :: (k -> a -> b -> b) -> b -> M.Map k a -> b)
{-# INLINE foldrWithKey #-}

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
foldlWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k b. (a -> k -> b -> a) -> a -> Map k b -> a
M.foldlWithKey :: (a -> k -> b -> a) -> a -> M.Map k b -> a)
{-# INLINE foldlWithKey #-}

foldMapWithKey :: forall k a m. Monoid m => (k -> a -> m) -> MonoidalMap k a -> m
foldMapWithKey :: forall k a m. Monoid m => (k -> a -> m) -> MonoidalMap k a -> m
foldMapWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall m k a. Monoid m => (k -> a -> m) -> Map k a -> m
M.foldMapWithKey :: Monoid m => (k -> a -> m) -> M.Map k a -> m)
{-# INLINE foldMapWithKey #-}

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
foldr' = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a b k. (a -> b -> b) -> b -> Map k a -> b
M.foldr' :: (a -> b -> b) -> b -> M.Map k a -> b)
{-# INLINE foldr' #-}

foldl' :: forall k a b. (a -> b -> a) -> a -> MonoidalMap k b -> a
foldl' :: forall k b a. (b -> a -> b) -> b -> MonoidalMap k a -> b
foldl' = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a b k. (a -> b -> a) -> a -> Map k b -> a
M.foldl' :: (a -> b -> a) -> a -> M.Map k b -> a)
{-# INLINE foldl' #-}

foldrWithKey' :: forall k a b. (k -> a -> b -> b) -> b -> MonoidalMap k a -> b
foldrWithKey' :: forall k a b. (k -> a -> b -> b) -> b -> MonoidalMap k a -> b
foldrWithKey' = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b. (k -> a -> b -> b) -> b -> Map k a -> b
M.foldrWithKey' :: (k -> a -> b -> b) -> b -> M.Map k a -> b)
{-# INLINE foldrWithKey' #-}

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
foldlWithKey' = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k b. (a -> k -> b -> a) -> a -> Map k b -> a
M.foldlWithKey' :: (a -> k -> b -> a) -> a -> M.Map k b -> a)
{-# INLINE foldlWithKey' #-}

keysSet :: forall k a. MonoidalMap k a -> Set k
keysSet :: forall k a. MonoidalMap k a -> Set k
keysSet = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Set k
M.keysSet :: M.Map k a -> Set k)
{-# INLINE keysSet #-}

fromSet :: forall k a. (k -> a) -> Set k -> MonoidalMap k a
fromSet :: forall k a. (k -> a) -> Set k -> MonoidalMap k a
fromSet = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> a) -> Set k -> Map k a
M.fromSet :: (k -> a) -> Set k -> M.Map k a)
{-# INLINE fromSet #-}

toList :: forall k a. MonoidalMap k a -> [(k, a)]
toList :: forall k a. MonoidalMap k a -> [(k, a)]
toList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> [(k, a)]
M.toList :: M.Map k a -> [(k, a)])
{-# INLINE toList #-}

fromList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
fromList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
fromList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => [(k, a)] -> Map k a
M.fromList :: [(k, a)] -> M.Map k a)
{-# INLINE fromList #-}

fromListWith :: forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromListWith :: forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromListWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
M.fromListWith :: (a -> a -> a) -> [(k, a)] -> M.Map k a)
{-# INLINE fromListWith #-}

fromListWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromListWithKey :: forall k a.
Ord k =>
(k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromListWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
M.fromListWithKey :: (k -> a -> a -> a) -> [(k, a)] -> M.Map k a)
{-# INLINE fromListWithKey #-}

toAscList :: forall k a. MonoidalMap k a -> [(k, a)]
toAscList :: forall k a. MonoidalMap k a -> [(k, a)]
toAscList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> [(k, a)]
M.toAscList :: M.Map k a -> [(k, a)])
{-# INLINE toAscList #-}

toDescList :: forall k a. MonoidalMap k a -> [(k, a)]
toDescList :: forall k a. MonoidalMap k a -> [(k, a)]
toDescList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> [(k, a)]
M.toDescList :: M.Map k a -> [(k, a)])
{-# INLINE toDescList #-}

fromAscList :: forall k a. Eq k => [(k, a)] -> MonoidalMap k a
fromAscList :: forall k a. Eq k => [(k, a)] -> MonoidalMap k a
fromAscList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Eq k => [(k, a)] -> Map k a
M.fromAscList :: [(k, a)] -> M.Map k a)
{-# INLINE fromAscList #-}

fromAscListWith :: forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromAscListWith :: forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromAscListWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> Map k a
M.fromAscListWith :: (a -> a -> a) -> [(k, a)] -> M.Map k a)
{-# INLINE fromAscListWith #-}

fromAscListWithKey :: forall k a. Eq k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromAscListWithKey :: forall k a.
Eq k =>
(k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromAscListWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
M.fromAscListWithKey :: (k -> a -> a -> a) -> [(k, a)] -> M.Map k a)
{-# INLINE fromAscListWithKey #-}

fromDistinctAscList :: forall k a. [(k, a)] -> MonoidalMap k a
fromDistinctAscList :: forall k a. [(k, a)] -> MonoidalMap k a
fromDistinctAscList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. [(k, a)] -> Map k a
M.fromDistinctAscList :: [(k, a)] -> M.Map k a)
{-# INLINE fromDistinctAscList #-}

fromDistinctList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
fromDistinctList :: forall k a. Ord k => [(k, a)] -> MonoidalMap k a
fromDistinctList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => [(k, a)] -> Map k a
M.fromList :: [(k, a)] -> M.Map k a)
{-# INLINE fromDistinctList #-}

fromDescList :: forall k a. Eq k => [(k, a)] -> MonoidalMap k a
fromDescList :: forall k a. Eq k => [(k, a)] -> MonoidalMap k a
fromDescList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Eq k => [(k, a)] -> Map k a
M.fromDescList :: [(k, a)] -> M.Map k a)
{-# INLINE fromDescList #-}

fromDescListWith :: forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromDescListWith :: forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromDescListWith = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> Map k a
M.fromDescListWith :: (a -> a -> a) -> [(k, a)] -> M.Map k a)
{-# INLINE fromDescListWith #-}

fromDescListWithKey :: forall k a. Eq k => (k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromDescListWithKey :: forall k a.
Eq k =>
(k -> a -> a -> a) -> [(k, a)] -> MonoidalMap k a
fromDescListWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
M.fromDescListWithKey :: (k -> a -> a -> a) -> [(k, a)] -> M.Map k a)
{-# INLINE fromDescListWithKey #-}

fromDistinctDescList :: forall k a. [(k, a)] -> MonoidalMap k a
fromDistinctDescList :: forall k a. [(k, a)] -> MonoidalMap k a
fromDistinctDescList = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. [(k, a)] -> Map k a
M.fromDistinctDescList :: [(k, a)] -> M.Map k a)
{-# INLINE fromDistinctDescList #-}

filter :: forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
filter :: forall k a. (a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
filter = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k. (a -> Bool) -> Map k a -> Map k a
M.filter :: (a -> Bool) -> M.Map k a -> M.Map k a)
{-# INLINE filter #-}

filterWithKey :: forall k a. (k -> a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
filterWithKey :: forall k a. (k -> a -> Bool) -> MonoidalMap k a -> MonoidalMap k a
filterWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> a -> Bool) -> Map k a -> Map k a
M.filterWithKey :: (k -> a -> Bool) -> M.Map k a -> M.Map k a)
{-# INLINE filterWithKey #-}

restrictKeys :: forall k a. Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a
restrictKeys :: forall k a. Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a
restrictKeys = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => Map k a -> Set k -> Map k a
M.restrictKeys :: M.Map k a -> Set k -> M.Map k a)
{-# INLINE restrictKeys #-}

withoutKeys :: forall k a. Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a
withoutKeys :: forall k a. Ord k => MonoidalMap k a -> Set k -> MonoidalMap k a
withoutKeys = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => Map k a -> Set k -> Map k a
M.withoutKeys :: M.Map k a -> Set k -> M.Map k a)
{-# INLINE withoutKeys #-}

partition :: forall k a. (a -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
partition :: forall k a.
(a -> Bool)
-> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
partition = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k. (a -> Bool) -> Map k a -> (Map k a, Map k a)
M.partition :: (a -> Bool) -> M.Map k a -> (M.Map k a, M.Map k a))
{-# INLINE partition #-}

partitionWithKey :: forall k a. (k -> a -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
partitionWithKey :: forall k a.
(k -> a -> Bool)
-> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
partitionWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> a -> Bool) -> Map k a -> (Map k a, Map k a)
M.partitionWithKey :: (k -> a -> Bool) -> M.Map k a -> (M.Map k a, M.Map k a))
{-# INLINE partitionWithKey #-}

takeWhileAntitone :: forall k a. (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a
takeWhileAntitone :: forall k a. (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a
takeWhileAntitone = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> Bool) -> Map k a -> Map k a
M.takeWhileAntitone :: (k -> Bool) -> M.Map k a -> M.Map k a)
{-# INLINE takeWhileAntitone #-}

dropWhileAntitone :: forall k a. (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a
dropWhileAntitone :: forall k a. (k -> Bool) -> MonoidalMap k a -> MonoidalMap k a
dropWhileAntitone = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> Bool) -> Map k a -> Map k a
M.dropWhileAntitone :: (k -> Bool) -> M.Map k a -> M.Map k a)
{-# INLINE dropWhileAntitone #-}

spanAntitone :: forall k a. (k -> Bool) -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
spanAntitone :: forall k a.
(k -> Bool)
-> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
spanAntitone = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> Bool) -> Map k a -> (Map k a, Map k a)
M.spanAntitone :: (k -> Bool) -> M.Map k a -> (M.Map k a, M.Map k a))
{-# INLINE spanAntitone #-}

mapMaybe :: forall k a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
mapMaybe :: forall k a b. (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
mapMaybe = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a b k. (a -> Maybe b) -> Map k a -> Map k b
M.mapMaybe :: (a -> Maybe b) -> M.Map k a -> M.Map k b)
{-# INLINE mapMaybe #-}

mapMaybeWithKey :: forall k a b. (k -> a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
mapMaybeWithKey :: forall k a b.
(k -> a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b
mapMaybeWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b. (k -> a -> Maybe b) -> Map k a -> Map k b
M.mapMaybeWithKey :: (k -> a -> Maybe b) -> M.Map k a -> M.Map k b)
{-# INLINE mapMaybeWithKey #-}

mapEither :: forall k a b c. (a -> Either b c) -> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c)
mapEither :: forall k a b c.
(a -> Either b c)
-> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c)
mapEither = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a b c k. (a -> Either b c) -> Map k a -> (Map k b, Map k c)
M.mapEither :: (a -> Either b c) -> M.Map k a -> (M.Map k b, M.Map k c))
{-# INLINE mapEither #-}

mapEitherWithKey :: forall k a b c. (k -> a -> Either b c) -> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c)
mapEitherWithKey :: forall k a b c.
(k -> a -> Either b c)
-> MonoidalMap k a -> (MonoidalMap k b, MonoidalMap k c)
mapEitherWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b c.
(k -> a -> Either b c) -> Map k a -> (Map k b, Map k c)
M.mapEitherWithKey :: (k -> a -> Either b c) -> M.Map k a -> (M.Map k b, M.Map k c))
{-# INLINE mapEitherWithKey #-}

split :: forall k a. Ord k => k -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
split :: forall k a.
Ord k =>
k -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
split = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => k -> Map k a -> (Map k a, Map k a)
M.split :: k -> M.Map k a -> (M.Map k a, M.Map k a))
{-# INLINE split #-}

splitLookup :: forall k a. Ord k => k -> MonoidalMap k a -> (MonoidalMap k a, Maybe a, MonoidalMap k a)
splitLookup :: forall k a.
Ord k =>
k -> MonoidalMap k a -> (MonoidalMap k a, Maybe a, MonoidalMap k a)
splitLookup = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a)
M.splitLookup :: k -> M.Map k a -> (M.Map k a, Maybe a, M.Map k a))
{-# INLINE splitLookup #-}

splitRoot :: forall k a. MonoidalMap k a -> [MonoidalMap k a]
splitRoot :: forall k a. MonoidalMap k a -> [MonoidalMap k a]
splitRoot = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k b. Map k b -> [Map k b]
M.splitRoot :: M.Map k a -> [M.Map k a])
{-# INLINE splitRoot #-}

isSubmapOf :: forall k a. (Ord k, Eq a) => MonoidalMap k a -> MonoidalMap k a -> Bool
isSubmapOf :: forall k a.
(Ord k, Eq a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
isSubmapOf = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (Ord k, Eq a) => Map k a -> Map k a -> Bool
M.isSubmapOf :: M.Map k a -> M.Map k a -> Bool)
{-# INLINE isSubmapOf #-}

isSubmapOfBy :: forall k a b. Ord k => (a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool
isSubmapOfBy :: forall k a b.
Ord k =>
(a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool
isSubmapOfBy = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b.
Ord k =>
(a -> b -> Bool) -> Map k a -> Map k b -> Bool
M.isSubmapOfBy :: (a -> b -> Bool) -> M.Map k a -> M.Map k b -> Bool)
{-# INLINE isSubmapOfBy #-}

isProperSubmapOf :: forall k a. (Ord k, Eq a) => MonoidalMap k a -> MonoidalMap k a -> Bool
isProperSubmapOf :: forall k a.
(Ord k, Eq a) =>
MonoidalMap k a -> MonoidalMap k a -> Bool
isProperSubmapOf = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (Ord k, Eq a) => Map k a -> Map k a -> Bool
M.isProperSubmapOf :: M.Map k a -> M.Map k a -> Bool)
{-# INLINE isProperSubmapOf #-}

isProperSubmapOfBy :: forall k a b. Ord k => (a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool
isProperSubmapOfBy :: forall k a b.
Ord k =>
(a -> b -> Bool) -> MonoidalMap k a -> MonoidalMap k b -> Bool
isProperSubmapOfBy = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a b.
Ord k =>
(a -> b -> Bool) -> Map k a -> Map k b -> Bool
M.isProperSubmapOfBy :: (a -> b -> Bool) -> M.Map k a -> M.Map k b -> Bool)
{-# INLINE isProperSubmapOfBy #-}

lookupIndex :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe Int
lookupIndex :: forall k a. Ord k => k -> MonoidalMap k a -> Maybe Int
lookupIndex = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => k -> Map k a -> Maybe Int
M.lookupIndex :: k -> M.Map k a -> Maybe Int)
{-# INLINE lookupIndex #-}

findIndex :: forall k a. Ord k => k -> MonoidalMap k a -> Int
findIndex :: forall k a. Ord k => k -> MonoidalMap k a -> Int
findIndex = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => k -> Map k a -> Int
M.findIndex :: k -> M.Map k a -> Int)
{-# INLINE findIndex #-}

elemAt :: forall k a. Int -> MonoidalMap k a -> (k, a)
elemAt :: forall k a. Int -> MonoidalMap k a -> (k, a)
elemAt = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Int -> Map k a -> (k, a)
M.elemAt :: Int -> M.Map k a -> (k, a))
{-# INLINE elemAt #-}

updateAt :: forall k a. (k -> a -> Maybe a) -> Int -> MonoidalMap k a -> MonoidalMap k a
updateAt :: forall k a.
(k -> a -> Maybe a) -> Int -> MonoidalMap k a -> MonoidalMap k a
updateAt = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> a -> Maybe a) -> Int -> Map k a -> Map k a
M.updateAt :: (k -> a -> Maybe a) -> Int -> M.Map k a -> M.Map k a)
{-# INLINE updateAt #-}

deleteAt :: forall k a. Int -> MonoidalMap k a -> MonoidalMap k a
deleteAt :: forall k a. Int -> MonoidalMap k a -> MonoidalMap k a
deleteAt = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Int -> Map k a -> Map k a
M.deleteAt :: Int -> M.Map k a -> M.Map k a)
{-# INLINE deleteAt #-}

take :: forall k a. Int -> MonoidalMap k a -> MonoidalMap k a
take :: forall k a. Int -> MonoidalMap k a -> MonoidalMap k a
take = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Int -> Map k a -> Map k a
M.take :: Int -> M.Map k a -> M.Map k a)
{-# INLINE take #-}

drop :: forall k a. Int -> MonoidalMap k a -> MonoidalMap k a
drop :: forall k a. Int -> MonoidalMap k a -> MonoidalMap k a
drop = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Int -> Map k a -> Map k a
M.drop :: Int -> M.Map k a -> M.Map k a)
{-# INLINE drop #-}

splitAt :: forall k a. Int -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
splitAt :: forall k a.
Int -> MonoidalMap k a -> (MonoidalMap k a, MonoidalMap k a)
splitAt = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Int -> Map k a -> (Map k a, Map k a)
M.splitAt :: Int -> M.Map k a -> (M.Map k a, M.Map k a))
{-# INLINE splitAt #-}

lookupMin :: forall k a. MonoidalMap k a -> Maybe (k, a)
lookupMin :: forall k a. MonoidalMap k a -> Maybe (k, a)
lookupMin = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Maybe (k, a)
M.lookupMin :: M.Map k a -> Maybe (k, a))
{-# INLINE lookupMin #-}

lookupMax :: forall k a. MonoidalMap k a -> Maybe (k, a)
lookupMax :: forall k a. MonoidalMap k a -> Maybe (k, a)
lookupMax = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Maybe (k, a)
M.lookupMax :: M.Map k a -> Maybe (k, a))
{-# INLINE lookupMax #-}

findMin :: forall k a. MonoidalMap k a -> (k, a)
findMin :: forall k a. MonoidalMap k a -> (k, a)
findMin = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> (k, a)
M.findMin :: M.Map k a -> (k, a))
{-# INLINE findMin #-}

findMax :: forall k a. MonoidalMap k a -> (k, a)
findMax :: forall k a. MonoidalMap k a -> (k, a)
findMax = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> (k, a)
M.findMax :: M.Map k a -> (k, a))
{-# INLINE findMax #-}

deleteMin :: forall k a. MonoidalMap k a -> MonoidalMap k a
deleteMin :: forall k a. MonoidalMap k a -> MonoidalMap k a
deleteMin = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Map k a
M.deleteMin :: M.Map k a -> M.Map k a)
{-# INLINE deleteMin #-}

deleteMax :: forall k a. MonoidalMap k a -> MonoidalMap k a
deleteMax :: forall k a. MonoidalMap k a -> MonoidalMap k a
deleteMax = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Map k a
M.deleteMax :: M.Map k a -> M.Map k a)
{-# INLINE deleteMax #-}

deleteFindMin :: forall k a. MonoidalMap k a -> ((k, a), MonoidalMap k a)
deleteFindMin :: forall k a. MonoidalMap k a -> ((k, a), MonoidalMap k a)
deleteFindMin = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> ((k, a), Map k a)
M.deleteFindMin :: M.Map k a -> ((k, a), M.Map k a))
{-# INLINE deleteFindMin #-}

deleteFindMax :: forall k a. MonoidalMap k a -> ((k, a), MonoidalMap k a)
deleteFindMax :: forall k a. MonoidalMap k a -> ((k, a), MonoidalMap k a)
deleteFindMax = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> ((k, a), Map k a)
M.deleteFindMax :: M.Map k a -> ((k, a), M.Map k a))
{-# INLINE deleteFindMax #-}

updateMin :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMin :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMin = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k. (a -> Maybe a) -> Map k a -> Map k a
M.updateMin :: (a -> Maybe a) -> M.Map k a -> M.Map k a)
{-# INLINE updateMin #-}

updateMax :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMax :: forall k a. (a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMax = coerce :: forall a b. Coercible a b => a -> b
coerce (forall a k. (a -> Maybe a) -> Map k a -> Map k a
M.updateMax :: (a -> Maybe a) -> M.Map k a -> M.Map k a)
{-# INLINE updateMax #-}

updateMinWithKey :: forall k a. (k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMinWithKey :: forall k a.
(k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMinWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> a -> Maybe a) -> Map k a -> Map k a
M.updateMinWithKey :: (k -> a -> Maybe a) -> M.Map k a -> M.Map k a)
{-# INLINE updateMinWithKey #-}

updateMaxWithKey :: forall k a. (k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMaxWithKey :: forall k a.
(k -> a -> Maybe a) -> MonoidalMap k a -> MonoidalMap k a
updateMaxWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. (k -> a -> Maybe a) -> Map k a -> Map k a
M.updateMaxWithKey :: (k -> a -> Maybe a) -> M.Map k a -> M.Map k a)
{-# INLINE updateMaxWithKey #-}

minView :: forall k a. MonoidalMap k a -> Maybe (a, MonoidalMap k a)
minView :: forall k a. MonoidalMap k a -> Maybe (a, MonoidalMap k a)
minView = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Maybe (a, Map k a)
M.minView :: M.Map k a -> Maybe (a, M.Map k a))
{-# INLINE minView #-}

maxView :: forall k a. MonoidalMap k a -> Maybe (a, MonoidalMap k a)
maxView :: forall k a. MonoidalMap k a -> Maybe (a, MonoidalMap k a)
maxView = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Maybe (a, Map k a)
M.maxView :: M.Map k a -> Maybe (a, M.Map k a))
{-# INLINE maxView #-}

minViewWithKey :: forall k a. MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a)
minViewWithKey :: forall k a. MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a)
minViewWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Maybe ((k, a), Map k a)
M.minViewWithKey :: M.Map k a -> Maybe ((k, a), M.Map k a))
{-# INLINE minViewWithKey #-}

maxViewWithKey :: forall k a. MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a)
maxViewWithKey :: forall k a. MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a)
maxViewWithKey = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Map k a -> Maybe ((k, a), Map k a)
M.maxViewWithKey :: M.Map k a -> Maybe ((k, a), M.Map k a))
{-# INLINE maxViewWithKey #-}

-- showTree :: forall k a. (Show k, Show a) => MonoidalMap k a -> String
-- showTree = coerce (M.showTree :: (Show k, Show a) => M.Map k a -> String)
-- {-# INLINE showTree #-}

-- showTreeWith :: forall k a. (k -> a -> String) -> Bool -> Bool -> MonoidalMap k a -> String
-- showTreeWith = coerce (M.showTreeWith :: (k -> a -> String) -> Bool -> Bool -> M.Map k a -> String)
-- {-# INLINE showTreeWith #-}

valid :: forall k a. Ord k => MonoidalMap k a -> Bool
valid :: forall k a. Ord k => MonoidalMap k a -> Bool
valid = coerce :: forall a b. Coercible a b => a -> b
coerce (forall k a. Ord k => Map k a -> Bool
M.valid :: Ord k => M.Map k a -> Bool)
{-# INLINE valid #-}