Copyright | (c) 2011-2019 Michal Terepeta (c) 2019-2022 Mikolaj Konarski and others (see git history) |
---|---|
License | BSD3 |
Maintainer | mikolaj.konarski@funktory.com |
Stability | alpha |
Portability | uses DeriveDataTypeable and GeneralizedNewtypeDeriving |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data EnumMap k a
- intMapToEnumMap :: IntMap a -> EnumMap k a
- enumMapToIntMap :: EnumMap k a -> IntMap a
- (!) :: Enum k => EnumMap k a -> k -> a
- (\\) :: EnumMap k a -> EnumMap k b -> EnumMap k a
- null :: EnumMap k a -> Bool
- size :: EnumMap k a -> Int
- member :: Enum k => k -> EnumMap k a -> Bool
- notMember :: Enum k => k -> EnumMap k a -> Bool
- lookup :: Enum k => k -> EnumMap k a -> Maybe a
- findWithDefault :: Enum k => a -> k -> EnumMap k a -> a
- lookupLT :: Enum k => k -> EnumMap k a -> Maybe (k, a)
- lookupGT :: Enum k => k -> EnumMap k a -> Maybe (k, a)
- lookupLE :: Enum k => k -> EnumMap k a -> Maybe (k, a)
- lookupGE :: Enum k => k -> EnumMap k a -> Maybe (k, a)
- empty :: EnumMap k a
- singleton :: Enum k => k -> a -> EnumMap k a
- insert :: Enum k => k -> a -> EnumMap k a -> EnumMap k a
- insertWith :: Enum k => (a -> a -> a) -> k -> a -> EnumMap k a -> EnumMap k a
- insertWithKey :: Enum k => (k -> a -> a -> a) -> k -> a -> EnumMap k a -> EnumMap k a
- insertLookupWithKey :: Enum k => (k -> a -> a -> a) -> k -> a -> EnumMap k a -> (Maybe a, EnumMap k a)
- delete :: Enum k => k -> EnumMap k a -> EnumMap k a
- adjust :: Enum k => (a -> a) -> k -> EnumMap k a -> EnumMap k a
- adjustWithKey :: Enum k => (k -> a -> a) -> k -> EnumMap k a -> EnumMap k a
- update :: Enum k => (a -> Maybe a) -> k -> EnumMap k a -> EnumMap k a
- updateWithKey :: Enum k => (k -> a -> Maybe a) -> k -> EnumMap k a -> EnumMap k a
- updateLookupWithKey :: Enum k => (k -> a -> Maybe a) -> k -> EnumMap k a -> (Maybe a, EnumMap k a)
- alter :: Enum k => (Maybe a -> Maybe a) -> k -> EnumMap k a -> EnumMap k a
- alterF :: (Enum k, Functor f) => (Maybe a -> f (Maybe a)) -> k -> EnumMap k a -> f (EnumMap k a)
- union :: EnumMap k a -> EnumMap k a -> EnumMap k a
- unionWith :: (a -> a -> a) -> EnumMap k a -> EnumMap k a -> EnumMap k a
- unionWithKey :: Enum k => (k -> a -> a -> a) -> EnumMap k a -> EnumMap k a -> EnumMap k a
- unions :: [EnumMap k a] -> EnumMap k a
- unionsWith :: (a -> a -> a) -> [EnumMap k a] -> EnumMap k a
- difference :: EnumMap k a -> EnumMap k b -> EnumMap k a
- differenceWith :: (a -> b -> Maybe a) -> EnumMap k a -> EnumMap k b -> EnumMap k a
- differenceWithKey :: Enum k => (k -> a -> b -> Maybe a) -> EnumMap k a -> EnumMap k b -> EnumMap k a
- intersection :: EnumMap k a -> EnumMap k b -> EnumMap k a
- intersectionWith :: (a -> b -> c) -> EnumMap k a -> EnumMap k b -> EnumMap k c
- intersectionWithKey :: Enum k => (k -> a -> b -> c) -> EnumMap k a -> EnumMap k b -> EnumMap k c
- 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
- map :: (a -> b) -> EnumMap k a -> EnumMap k b
- mapWithKey :: Enum k => (k -> a -> b) -> EnumMap k a -> EnumMap k b
- traverseWithKey :: (Applicative t, Enum k) => (k -> a -> t b) -> EnumMap k a -> t (EnumMap k b)
- mapAccum :: (a -> b -> (a, c)) -> a -> EnumMap k b -> (a, EnumMap k c)
- mapAccumWithKey :: Enum k => (a -> k -> b -> (a, c)) -> a -> EnumMap k b -> (a, EnumMap k c)
- mapAccumRWithKey :: Enum k => (a -> k -> b -> (a, c)) -> a -> EnumMap k b -> (a, EnumMap k c)
- mapKeys :: Enum k => (k -> k) -> EnumMap k a -> EnumMap k a
- mapKeysWith :: Enum k => (a -> a -> a) -> (k -> k) -> EnumMap k a -> EnumMap k a
- mapKeysMonotonic :: Enum k => (k -> k) -> EnumMap k a -> EnumMap k a
- foldr :: (a -> b -> b) -> b -> EnumMap k a -> b
- foldl :: (a -> b -> a) -> a -> EnumMap k b -> a
- foldrWithKey :: Enum k => (k -> a -> b -> b) -> b -> EnumMap k a -> b
- foldlWithKey :: Enum k => (a -> k -> b -> a) -> a -> EnumMap k b -> a
- foldr' :: (a -> b -> b) -> b -> EnumMap k a -> b
- foldl' :: (a -> b -> a) -> a -> EnumMap k b -> a
- foldrWithKey' :: Enum k => (k -> a -> b -> b) -> b -> EnumMap k a -> b
- foldlWithKey' :: Enum k => (a -> k -> b -> a) -> a -> EnumMap k b -> a
- elems :: EnumMap k a -> [a]
- keys :: Enum k => EnumMap k a -> [k]
- assocs :: Enum k => EnumMap k a -> [(k, a)]
- keysSet :: Enum k => EnumMap k a -> EnumSet k
- fromSet :: Enum k => (k -> a) -> EnumSet k -> EnumMap k a
- toList :: Enum k => EnumMap k a -> [(k, a)]
- fromList :: Enum k => [(k, a)] -> EnumMap k a
- fromListWith :: Enum k => (a -> a -> a) -> [(k, a)] -> EnumMap k a
- fromListWithKey :: Enum k => (k -> a -> a -> a) -> [(k, a)] -> EnumMap k a
- toAscList :: Enum k => EnumMap k a -> [(k, a)]
- toDescList :: Enum k => EnumMap k a -> [(k, a)]
- fromAscList :: Enum k => [(k, a)] -> EnumMap k a
- fromAscListWith :: Enum k => (a -> a -> a) -> [(k, a)] -> EnumMap k a
- fromAscListWithKey :: Enum k => (k -> a -> a -> a) -> [(k, a)] -> EnumMap k a
- fromDistinctAscList :: Enum k => [(k, a)] -> EnumMap k a
- filter :: (a -> Bool) -> EnumMap k a -> EnumMap k a
- filterWithKey :: Enum k => (k -> a -> Bool) -> EnumMap k a -> EnumMap k a
- restrictKeys :: Enum k => EnumMap k a -> EnumSet k -> EnumMap k a
- withoutKeys :: Enum k => EnumMap k a -> EnumSet k -> EnumMap k a
- partition :: (a -> Bool) -> EnumMap k a -> (EnumMap k a, EnumMap k a)
- partitionWithKey :: Enum k => (k -> a -> Bool) -> EnumMap k a -> (EnumMap k a, EnumMap k a)
- mapMaybe :: (a -> Maybe b) -> EnumMap k a -> EnumMap k b
- mapMaybeWithKey :: Enum k => (k -> a -> Maybe b) -> EnumMap k a -> EnumMap k b
- mapEither :: (a -> Either b c) -> EnumMap k a -> (EnumMap k b, EnumMap k c)
- mapEitherWithKey :: Enum k => (k -> a -> Either b c) -> EnumMap k a -> (EnumMap k b, EnumMap k c)
- split :: Enum k => k -> EnumMap k a -> (EnumMap k a, EnumMap k a)
- splitLookup :: Enum k => k -> EnumMap k a -> (EnumMap k a, Maybe a, EnumMap k a)
- isSubmapOf :: Eq a => EnumMap k a -> EnumMap k a -> Bool
- isSubmapOfBy :: (a -> b -> Bool) -> EnumMap k a -> EnumMap k b -> Bool
- isProperSubmapOf :: Eq a => EnumMap k a -> EnumMap k a -> Bool
- isProperSubmapOfBy :: (a -> b -> Bool) -> EnumMap k a -> EnumMap k b -> Bool
- lookupMin :: Enum k => EnumMap k a -> Maybe (k, a)
- lookupMax :: Enum k => EnumMap k a -> Maybe (k, a)
- findMin :: Enum k => EnumMap k a -> (k, a)
- findMax :: Enum k => EnumMap k a -> (k, a)
- deleteMin :: EnumMap k a -> EnumMap k a
- deleteMax :: EnumMap k a -> EnumMap k a
- deleteFindMin :: Enum k => EnumMap k a -> ((k, a), EnumMap k a)
- deleteFindMax :: Enum k => EnumMap k a -> ((k, a), EnumMap k a)
- updateMin :: (a -> Maybe a) -> EnumMap k a -> EnumMap k a
- updateMax :: (a -> Maybe a) -> EnumMap k a -> EnumMap k a
- updateMinWithKey :: Enum k => (k -> a -> Maybe a) -> EnumMap k a -> EnumMap k a
- updateMaxWithKey :: Enum k => (k -> a -> Maybe a) -> EnumMap k a -> EnumMap k a
- minView :: EnumMap k a -> Maybe (a, EnumMap k a)
- maxView :: EnumMap k a -> Maybe (a, EnumMap k a)
- minViewWithKey :: Enum k => EnumMap k a -> Maybe ((k, a), EnumMap k a)
- maxViewWithKey :: Enum k => EnumMap k a -> Maybe ((k, a), EnumMap k a)
Documentation
Instances
Foldable (EnumMap k) Source # | |
Defined in Data.EnumMap.Base 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] # 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 # | |
Traversable (EnumMap k) Source # | |
Functor (EnumMap k) Source # | |
FromJSON a => FromJSON (EnumMap k a) Source # | |
ToJSON a => ToJSON (EnumMap k a) Source # | |
Defined in Data.EnumMap.Base | |
Monoid (EnumMap k a) Source # | |
Semigroup (EnumMap k a) Source # | |
(Enum k, Read k, Read a) => Read (EnumMap k a) Source # | |
(Enum k, Show k, Show a) => Show (EnumMap k a) Source # | |
NFData a => NFData (EnumMap k a) Source # | |
Defined in Data.EnumMap.Base | |
Eq a => Eq (EnumMap k a) Source # | |
Ord a => Ord (EnumMap k a) Source # | |
Defined in Data.EnumMap.Base |
Wrapping/unwrapping
Operators
Query
findWithDefault :: Enum k => a -> k -> EnumMap k a -> a Source #
Construction
Insertion
insertLookupWithKey :: Enum k => (k -> a -> a -> a) -> k -> a -> EnumMap k a -> (Maybe a, EnumMap k a) Source #
Delete/Update
updateLookupWithKey :: Enum k => (k -> a -> Maybe a) -> k -> EnumMap k a -> (Maybe 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
unionsWith :: (a -> a -> a) -> [EnumMap k a] -> EnumMap k a Source #
Difference
differenceWithKey :: Enum k => (k -> a -> b -> Maybe a) -> EnumMap k a -> EnumMap k b -> EnumMap k a Source #
Intersection
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
traverseWithKey :: (Applicative t, Enum k) => (k -> a -> t b) -> EnumMap k a -> t (EnumMap k b) 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 #
Folds
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
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
Lists
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
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
partitionWithKey :: Enum k => (k -> a -> Bool) -> EnumMap k a -> (EnumMap k a, EnumMap k a) Source #
mapEitherWithKey :: Enum k => (k -> a -> Either b c) -> EnumMap k a -> (EnumMap k b, EnumMap k c) Source #