enummapset-0.7.2.0: IntMap and IntSet with Enum keys/elements.
Copyright(c) 2011-2019 Michal Terepeta
(c) 2019-2022 Mikolaj Konarski and others (see git history)
LicenseBSD3
Maintainermikolaj.konarski@funktory.com
Stabilityalpha
Portabilityuses DeriveDataTypeable and GeneralizedNewtypeDeriving
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.EnumMap.Lazy

Description

 
Synopsis

Documentation

data EnumMap k a Source #

Wrapper for IntMap with Enum keys.

Instances

Instances details
Foldable (EnumMap k) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

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

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

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

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

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

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

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

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

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

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

null :: EnumMap k a -> Bool #

length :: EnumMap k a -> Int #

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

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

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

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

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

Traversable (EnumMap k) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

traverse :: Applicative f => (a -> f b) -> EnumMap k a -> f (EnumMap k b) #

sequenceA :: Applicative f => EnumMap k (f a) -> f (EnumMap k a) #

mapM :: Monad m => (a -> m b) -> EnumMap k a -> m (EnumMap k b) #

sequence :: Monad m => EnumMap k (m a) -> m (EnumMap k a) #

Functor (EnumMap k) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

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

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

FromJSON a => FromJSON (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

ToJSON a => ToJSON (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

Monoid (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

mempty :: EnumMap k a #

mappend :: EnumMap k a -> EnumMap k a -> EnumMap k a #

mconcat :: [EnumMap k a] -> EnumMap k a #

Semigroup (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

(<>) :: EnumMap k a -> EnumMap k a -> EnumMap k a #

sconcat :: NonEmpty (EnumMap k a) -> EnumMap k a #

stimes :: Integral b => b -> EnumMap k a -> EnumMap k a #

(Enum k, Read k, Read a) => Read (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

(Enum k, Show k, Show a) => Show (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

showsPrec :: Int -> EnumMap k a -> ShowS #

show :: EnumMap k a -> String #

showList :: [EnumMap k a] -> ShowS #

NFData a => NFData (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

rnf :: EnumMap k a -> () #

Eq a => Eq (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

(==) :: EnumMap k a -> EnumMap k a -> Bool #

(/=) :: EnumMap k a -> EnumMap k a -> Bool #

Ord a => Ord (EnumMap k a) Source # 
Instance details

Defined in Data.EnumMap.Base

Methods

compare :: EnumMap k a -> EnumMap k a -> Ordering #

(<) :: EnumMap k a -> EnumMap k a -> Bool #

(<=) :: EnumMap k a -> EnumMap k a -> Bool #

(>) :: EnumMap k a -> EnumMap k a -> Bool #

(>=) :: EnumMap k a -> EnumMap k a -> Bool #

max :: EnumMap k a -> EnumMap k a -> EnumMap k a #

min :: EnumMap k a -> EnumMap k a -> EnumMap k a #

Wrapping/unwrapping

Operators

(!) :: Enum k => EnumMap k a -> k -> a Source #

(\\) :: EnumMap k a -> EnumMap k b -> EnumMap k a Source #

Query

size :: EnumMap k a -> Int Source #

member :: Enum k => k -> EnumMap k a -> Bool Source #

notMember :: Enum k => k -> EnumMap k a -> Bool Source #

lookup :: Enum k => k -> EnumMap k a -> Maybe a Source #

findWithDefault :: Enum k => a -> k -> EnumMap k a -> a Source #

lookupLT :: Enum k => k -> EnumMap k a -> Maybe (k, a) Source #

lookupGT :: Enum k => k -> EnumMap k a -> Maybe (k, a) Source #

lookupLE :: Enum k => k -> EnumMap k a -> Maybe (k, a) Source #

lookupGE :: Enum k => k -> EnumMap k a -> Maybe (k, a) Source #

Construction

singleton :: Enum k => k -> a -> EnumMap k a Source #

Insertion

insert :: Enum k => k -> a -> EnumMap k a -> EnumMap k a Source #

insertWith :: Enum k => (a -> a -> a) -> k -> a -> EnumMap k a -> EnumMap k a Source #

insertWithKey :: Enum k => (k -> a -> a -> a) -> k -> a -> EnumMap k a -> EnumMap k a Source #

insertLookupWithKey :: Enum k => (k -> a -> a -> a) -> k -> a -> EnumMap k a -> (Maybe a, EnumMap k a) Source #

Delete/Update

delete :: Enum k => k -> EnumMap k a -> EnumMap k a Source #

adjust :: Enum k => (a -> a) -> k -> EnumMap k a -> EnumMap k a Source #

adjustWithKey :: Enum k => (k -> a -> a) -> k -> EnumMap k a -> EnumMap k a Source #

update :: Enum k => (a -> Maybe a) -> k -> EnumMap k a -> EnumMap k a Source #

updateWithKey :: Enum k => (k -> a -> Maybe a) -> k -> EnumMap k a -> EnumMap k a Source #

updateLookupWithKey :: Enum k => (k -> a -> Maybe a) -> k -> EnumMap k a -> (Maybe a, EnumMap k a) Source #

alter :: Enum k => (Maybe a -> Maybe a) -> k -> EnumMap k a -> EnumMap k a Source #

alterF :: (Enum k, Functor f) => (Maybe a -> f (Maybe a)) -> k -> EnumMap k a -> f (EnumMap k a) Source #

Combine

Union

union :: EnumMap k a -> EnumMap k a -> EnumMap k a Source #

unionWith :: (a -> a -> a) -> EnumMap k a -> EnumMap k a -> EnumMap k a Source #

unionWithKey :: Enum k => (k -> a -> a -> a) -> EnumMap k a -> EnumMap k a -> EnumMap k a Source #

unions :: [EnumMap k a] -> EnumMap k a Source #

unionsWith :: (a -> a -> a) -> [EnumMap k a] -> EnumMap k a Source #

Difference

difference :: EnumMap k a -> EnumMap k b -> EnumMap k a Source #

differenceWith :: (a -> b -> Maybe a) -> EnumMap k a -> EnumMap k b -> EnumMap k a Source #

differenceWithKey :: Enum k => (k -> a -> b -> Maybe a) -> EnumMap k a -> EnumMap k b -> EnumMap k a Source #

Intersection

intersectionWith :: (a -> b -> c) -> EnumMap k a -> EnumMap k b -> EnumMap k c Source #

intersectionWithKey :: Enum k => (k -> a -> b -> c) -> EnumMap k a -> EnumMap k b -> EnumMap k c Source #

Universal combining function

mergeWithKey :: Enum k => (k -> a -> b -> Maybe c) -> (EnumMap k a -> EnumMap k c) -> (EnumMap k b -> EnumMap k c) -> EnumMap k a -> EnumMap k b -> EnumMap k c Source #

Traversal

Map

map :: (a -> b) -> EnumMap k a -> EnumMap k b Source #

mapWithKey :: Enum k => (k -> a -> b) -> EnumMap k a -> EnumMap k b Source #

traverseWithKey :: (Applicative t, Enum k) => (k -> a -> t b) -> EnumMap k a -> t (EnumMap k b) Source #

mapAccum :: (a -> b -> (a, c)) -> a -> EnumMap k b -> (a, EnumMap k c) Source #

mapAccumWithKey :: Enum k => (a -> k -> b -> (a, c)) -> a -> EnumMap k b -> (a, EnumMap k c) Source #

mapAccumRWithKey :: Enum k => (a -> k -> b -> (a, c)) -> a -> EnumMap k b -> (a, EnumMap k c) Source #

mapKeys :: Enum k => (k -> k) -> EnumMap k a -> EnumMap k a Source #

mapKeysWith :: Enum k => (a -> a -> a) -> (k -> k) -> EnumMap k a -> EnumMap k a Source #

mapKeysMonotonic :: Enum k => (k -> k) -> EnumMap k a -> EnumMap k a Source #

Folds

foldr :: (a -> b -> b) -> b -> EnumMap k a -> b Source #

foldl :: (a -> b -> a) -> a -> EnumMap k b -> a Source #

foldrWithKey :: Enum k => (k -> a -> b -> b) -> b -> EnumMap k a -> b Source #

foldlWithKey :: Enum k => (a -> k -> b -> a) -> a -> EnumMap k b -> a Source #

Strict folds

foldr' :: (a -> b -> b) -> b -> EnumMap k a -> b Source #

foldl' :: (a -> b -> a) -> a -> EnumMap k b -> a Source #

foldrWithKey' :: Enum k => (k -> a -> b -> b) -> b -> EnumMap k a -> b Source #

foldlWithKey' :: Enum k => (a -> k -> b -> a) -> a -> EnumMap k b -> a Source #

Conversion

elems :: EnumMap k a -> [a] Source #

keys :: Enum k => EnumMap k a -> [k] Source #

assocs :: Enum k => EnumMap k a -> [(k, a)] Source #

keysSet :: Enum k => EnumMap k a -> EnumSet k Source #

fromSet :: Enum k => (k -> a) -> EnumSet k -> EnumMap k a Source #

Lists

toList :: Enum k => EnumMap k a -> [(k, a)] Source #

fromList :: Enum k => [(k, a)] -> EnumMap k a Source #

fromListWith :: Enum k => (a -> a -> a) -> [(k, a)] -> EnumMap k a Source #

fromListWithKey :: Enum k => (k -> a -> a -> a) -> [(k, a)] -> EnumMap k a Source #

Ordered lists

toAscList :: Enum k => EnumMap k a -> [(k, a)] Source #

toDescList :: Enum k => EnumMap k a -> [(k, a)] Source #

fromAscList :: Enum k => [(k, a)] -> EnumMap k a Source #

fromAscListWith :: Enum k => (a -> a -> a) -> [(k, a)] -> EnumMap k a Source #

fromAscListWithKey :: Enum k => (k -> a -> a -> a) -> [(k, a)] -> EnumMap k a Source #

fromDistinctAscList :: Enum k => [(k, a)] -> EnumMap k a Source #

Filter

filter :: (a -> Bool) -> EnumMap k a -> EnumMap k a Source #

filterWithKey :: Enum k => (k -> a -> Bool) -> EnumMap k a -> EnumMap k a Source #

restrictKeys :: Enum k => EnumMap k a -> EnumSet k -> EnumMap k a Source #

withoutKeys :: Enum k => EnumMap k a -> EnumSet k -> EnumMap k a Source #

partition :: (a -> Bool) -> EnumMap k a -> (EnumMap k a, EnumMap k a) Source #

partitionWithKey :: Enum k => (k -> a -> Bool) -> EnumMap k a -> (EnumMap k a, EnumMap k a) Source #

mapMaybe :: (a -> Maybe b) -> EnumMap k a -> EnumMap k b Source #

mapMaybeWithKey :: Enum k => (k -> a -> Maybe b) -> EnumMap k a -> EnumMap k b Source #

mapEither :: (a -> Either b c) -> EnumMap k a -> (EnumMap k b, EnumMap k c) Source #

mapEitherWithKey :: Enum k => (k -> a -> Either b c) -> EnumMap k a -> (EnumMap k b, EnumMap k c) Source #

split :: Enum k => k -> EnumMap k a -> (EnumMap k a, EnumMap k a) Source #

splitLookup :: Enum k => k -> EnumMap k a -> (EnumMap k a, Maybe a, EnumMap k a) Source #

Submap

isSubmapOf :: Eq a => EnumMap k a -> EnumMap k a -> Bool Source #

isSubmapOfBy :: (a -> b -> Bool) -> EnumMap k a -> EnumMap k b -> Bool Source #

isProperSubmapOfBy :: (a -> b -> Bool) -> EnumMap k a -> EnumMap k b -> Bool Source #

Min/Max

lookupMin :: Enum k => EnumMap k a -> Maybe (k, a) Source #

lookupMax :: Enum k => EnumMap k a -> Maybe (k, a) Source #

findMin :: Enum k => EnumMap k a -> (k, a) Source #

findMax :: Enum k => EnumMap k a -> (k, a) Source #

deleteFindMin :: Enum k => EnumMap k a -> ((k, a), EnumMap k a) Source #

deleteFindMax :: Enum k => EnumMap k a -> ((k, a), EnumMap k a) Source #

updateMin :: (a -> Maybe a) -> EnumMap k a -> EnumMap k a Source #

updateMax :: (a -> Maybe a) -> EnumMap k a -> EnumMap k a Source #

updateMinWithKey :: Enum k => (k -> a -> Maybe a) -> EnumMap k a -> EnumMap k a Source #

updateMaxWithKey :: Enum k => (k -> a -> Maybe a) -> EnumMap k a -> EnumMap k a Source #

minView :: EnumMap k a -> Maybe (a, EnumMap k a) Source #

maxView :: EnumMap k a -> Maybe (a, EnumMap k a) Source #

minViewWithKey :: Enum k => EnumMap k a -> Maybe ((k, a), EnumMap k a) Source #

maxViewWithKey :: Enum k => EnumMap k a -> Maybe ((k, a), EnumMap k a) Source #