Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data InsOrdHashMap k v
- adjust :: (Eq k, Hashable k) => (v -> v) -> k -> InsOrdHashMap k v -> InsOrdHashMap k v
- alter :: (Eq k, Hashable k) => (Maybe v -> Maybe v) -> k -> InsOrdHashMap k v -> InsOrdHashMap k v
- delete :: (Eq k, Hashable k) => k -> InsOrdHashMap k v -> InsOrdHashMap k v
- difference :: (Eq k, Hashable k) => InsOrdHashMap k v -> InsOrdHashMap k w -> InsOrdHashMap k v
- elems :: InsOrdHashMap k v -> [v]
- empty :: InsOrdHashMap k v
- filter :: (v -> Bool) -> InsOrdHashMap k v -> InsOrdHashMap k v
- filterWithKey :: (k -> v -> Bool) -> InsOrdHashMap k v -> InsOrdHashMap k v
- foldMapWithKey :: Monoid m => (k -> a -> m) -> InsOrdHashMap k a -> m
- foldl' :: (a -> v -> a) -> a -> InsOrdHashMap k v -> a
- foldlWithKey' :: (a -> k -> v -> a) -> a -> InsOrdHashMap k v -> a
- foldr :: (v -> a -> a) -> a -> InsOrdHashMap k v -> a
- foldrWithKey :: (k -> v -> a -> a) -> a -> InsOrdHashMap k v -> a
- fromHashMap :: HashMap k v -> InsOrdHashMap k v
- fromList :: (Eq k, Hashable k) => [(k, v)] -> InsOrdHashMap k v
- insert :: (Eq k, Hashable k) => k -> v -> InsOrdHashMap k v -> InsOrdHashMap k v
- insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> InsOrdHashMap k v -> InsOrdHashMap k v
- intersection :: (Eq k, Hashable k) => InsOrdHashMap k v -> InsOrdHashMap k w -> InsOrdHashMap k v
- intersectionWith :: (Eq k, Hashable k) => (v1 -> v2 -> v3) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 -> InsOrdHashMap k v3
- intersectionWithKey :: (Eq k, Hashable k) => (k -> v1 -> v2 -> v3) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 -> InsOrdHashMap k v3
- keys :: InsOrdHashMap k v -> [k]
- lookup :: (Eq k, Hashable k) => k -> InsOrdHashMap k v -> Maybe v
- lookupDefault :: (Eq k, Hashable k) => v -> k -> InsOrdHashMap k v -> v
- map :: (v1 -> v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2
- mapKeys :: (Eq k', Hashable k') => (k -> k') -> InsOrdHashMap k v -> InsOrdHashMap k' v
- mapMaybe :: (v1 -> Maybe v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2
- mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2
- mapWithKey :: (k -> v1 -> v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2
- member :: (Eq k, Hashable k) => k -> InsOrdHashMap k a -> Bool
- null :: InsOrdHashMap k v -> Bool
- singleton :: Hashable k => k -> v -> InsOrdHashMap k v
- size :: InsOrdHashMap k v -> Int
- toHashMap :: InsOrdHashMap k v -> HashMap k v
- toList :: InsOrdHashMap k v -> [(k, v)]
- toRevList :: InsOrdHashMap k v -> [(k, v)]
- traverseKeys :: (Eq k', Hashable k', Applicative f) => (k -> f k') -> InsOrdHashMap k v -> f (InsOrdHashMap k' v)
- traverseWithKey :: Applicative f => (k -> a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b)
- union :: (Eq k, Hashable k) => InsOrdHashMap k v -> InsOrdHashMap k v -> InsOrdHashMap k v
- unionWith :: (Eq k, Hashable k) => (v -> v -> v) -> InsOrdHashMap k v -> InsOrdHashMap k v -> InsOrdHashMap k v
- unionWithKey :: (Eq k, Hashable k) => (k -> v -> v -> v) -> InsOrdHashMap k v -> InsOrdHashMap k v -> InsOrdHashMap k v
- unions :: (Eq k, Hashable k, Foldable f) => f (InsOrdHashMap k v) -> InsOrdHashMap k v
- unorderedFoldMap :: Monoid m => (a -> m) -> InsOrdHashMap k a -> m
- unorderedFoldMapWithKey :: Monoid m => (k -> a -> m) -> InsOrdHashMap k a -> m
- unorderedTraverse :: Applicative f => (a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b)
- unorderedTraverseWithKey :: Applicative f => (k -> a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b)
- update :: (Eq k, Hashable k) => (a -> Maybe a) -> k -> InsOrdHashMap k a -> InsOrdHashMap k a
- hashMap :: (Profunctor p, Functor f) => p (HashMap k a) (f (HashMap k b)) -> p (InsOrdHashMap k a) (f (InsOrdHashMap k b))
- unorderedTraversal :: Applicative f => (a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b)
InsOrdHashMap
data InsOrdHashMap k v #
HashMap
which tries it's best to remember insertion order of elements.
Instances
adjust :: (Eq k, Hashable k) => (v -> v) -> k -> InsOrdHashMap k v -> InsOrdHashMap k v #
alter :: (Eq k, Hashable k) => (Maybe v -> Maybe v) -> k -> InsOrdHashMap k v -> InsOrdHashMap k v #
delete :: (Eq k, Hashable k) => k -> InsOrdHashMap k v -> InsOrdHashMap k v #
difference :: (Eq k, Hashable k) => InsOrdHashMap k v -> InsOrdHashMap k w -> InsOrdHashMap k v #
elems :: InsOrdHashMap k v -> [v] #
empty :: InsOrdHashMap k v #
filter :: (v -> Bool) -> InsOrdHashMap k v -> InsOrdHashMap k v #
filterWithKey :: (k -> v -> Bool) -> InsOrdHashMap k v -> InsOrdHashMap k v #
foldMapWithKey :: Monoid m => (k -> a -> m) -> InsOrdHashMap k a -> m #
foldl' :: (a -> v -> a) -> a -> InsOrdHashMap k v -> a #
foldlWithKey' :: (a -> k -> v -> a) -> a -> InsOrdHashMap k v -> a #
foldr :: (v -> a -> a) -> a -> InsOrdHashMap k v -> a #
foldrWithKey :: (k -> v -> a -> a) -> a -> InsOrdHashMap k v -> a #
fromHashMap :: HashMap k v -> InsOrdHashMap k v #
fromList :: (Eq k, Hashable k) => [(k, v)] -> InsOrdHashMap k v #
insert :: (Eq k, Hashable k) => k -> v -> InsOrdHashMap k v -> InsOrdHashMap k v #
insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> InsOrdHashMap k v -> InsOrdHashMap k v #
intersection :: (Eq k, Hashable k) => InsOrdHashMap k v -> InsOrdHashMap k w -> InsOrdHashMap k v #
intersectionWith :: (Eq k, Hashable k) => (v1 -> v2 -> v3) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 -> InsOrdHashMap k v3 #
intersectionWithKey :: (Eq k, Hashable k) => (k -> v1 -> v2 -> v3) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 -> InsOrdHashMap k v3 #
keys :: InsOrdHashMap k v -> [k] #
:: (Eq k, Hashable k) | |
=> v | Default value to return. |
-> k | |
-> InsOrdHashMap k v | |
-> v |
map :: (v1 -> v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 #
mapKeys :: (Eq k', Hashable k') => (k -> k') -> InsOrdHashMap k v -> InsOrdHashMap k' v #
Order preserving mapping of keys.
mapMaybe :: (v1 -> Maybe v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 #
mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 #
mapWithKey :: (k -> v1 -> v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2 #
null :: InsOrdHashMap k v -> Bool #
singleton :: Hashable k => k -> v -> InsOrdHashMap k v #
size :: InsOrdHashMap k v -> Int #
toHashMap :: InsOrdHashMap k v -> HashMap k v #
toList :: InsOrdHashMap k v -> [(k, v)] #
toRevList :: InsOrdHashMap k v -> [(k, v)] #
traverseKeys :: (Eq k', Hashable k', Applicative f) => (k -> f k') -> InsOrdHashMap k v -> f (InsOrdHashMap k' v) #
traverseWithKey :: Applicative f => (k -> a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b) #
union :: (Eq k, Hashable k) => InsOrdHashMap k v -> InsOrdHashMap k v -> InsOrdHashMap k v #
unionWith :: (Eq k, Hashable k) => (v -> v -> v) -> InsOrdHashMap k v -> InsOrdHashMap k v -> InsOrdHashMap k v #
The union of two maps. If a key occurs in both maps, the provided function (first argument) will be used to compute the result.
Ordered traversal will go thru keys in the first map first.
unionWithKey :: (Eq k, Hashable k) => (k -> v -> v -> v) -> InsOrdHashMap k v -> InsOrdHashMap k v -> InsOrdHashMap k v #
unions :: (Eq k, Hashable k, Foldable f) => f (InsOrdHashMap k v) -> InsOrdHashMap k v #
unorderedFoldMap :: Monoid m => (a -> m) -> InsOrdHashMap k a -> m #
More efficient than foldMap
, when folding in insertion order is not important.
unorderedFoldMapWithKey :: Monoid m => (k -> a -> m) -> InsOrdHashMap k a -> m #
More efficient than foldMapWithKey
, when folding in insertion order is not important.
unorderedTraverse :: Applicative f => (a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b) #
More efficient than traverse
, when traversing in insertion order is not important.
unorderedTraverseWithKey :: Applicative f => (k -> a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b) #
More efficient than traverseWithKey
, when traversing in insertion order is not important.
update :: (Eq k, Hashable k) => (a -> Maybe a) -> k -> InsOrdHashMap k a -> InsOrdHashMap k a #
Optics
hashMap :: (Profunctor p, Functor f) => p (HashMap k a) (f (HashMap k b)) -> p (InsOrdHashMap k a) (f (InsOrdHashMap k b)) #
This is a slight lie, as roundtrip doesn't preserve ordering.
unorderedTraversal :: Applicative f => (a -> f b) -> InsOrdHashMap k a -> f (InsOrdHashMap k b) #