enummapset-0.5.2.1: IntMap and IntSet with Enum keys/elements.

Copyright(c) 2011-2013 Michal Terepeta
LicenseBSD3
Maintainermichal.terepeta@gmail.com
Stabilityalpha
Portabilityuses DeriveDataTypeable and GeneralizedNewtypeDeriving
Safe HaskellNone
LanguageHaskell98

Data.EnumMap.Lazy

Contents

Description

 

Synopsis

Documentation

data EnumMap k a Source

Wrapper for IntMap with Enum keys.

Instances

Functor (EnumMap k) 
Foldable (EnumMap k) 
Traversable (EnumMap k) 
Eq a => Eq (EnumMap k a) 
Ord a => Ord (EnumMap k a) 
(Enum k, Read k, Read a) => Read (EnumMap k a) 
(Enum k, Show k, Show a) => Show (EnumMap k a) 
Monoid (EnumMap k a) 
NFData a => NFData (EnumMap k a) 
Typeable (* -> * -> *) EnumMap 

Wrapping/unwrapping

Operators

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

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

Query

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

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

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

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