Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Map k v
- pure :: Bounded k => v -> Map k v
- singleton :: (Bounded k, Enum k, Ord k, Eq v) => v -> k -> k -> v -> Map k v
- lookup :: Ord k => k -> Map k v -> v
- fromList :: (Bounded k, Ord k, Enum k, Eq v) => v -> [(k, k, v)] -> Map k v
- unionWith :: (Ord k, Eq c) => (a -> b -> c) -> Map k a -> Map k b -> Map k c
- map :: Eq w => (v -> w) -> Map k v -> Map k w
- mapBijection :: (v -> w) -> Map k v -> Map k w
- traverseBijectionP :: PrimMonad m => (v -> m w) -> Map k v -> m (Map k w)
- traverseBijection :: Applicative m => (v -> m w) -> Map k v -> m (Map k w)
- foldl' :: (b -> v -> b) -> b -> Map k v -> b
- foldMap :: Monoid m => (v -> m) -> Map k v -> m
- foldrWithKey :: (Bounded k, Enum k) => (k -> k -> v -> b -> b) -> b -> Map k v -> b
- foldlWithKeyM' :: (Bounded k, Enum k, Monad m) => (b -> k -> k -> v -> m b) -> b -> Map k v -> m b
- traverse_ :: Applicative m => (v -> m w) -> Map k v -> m ()
- elems :: Map k v -> Array v
Documentation
A total interval map from keys k
to values v
. The key type must be discrete
and bounded. This map is strict in the values.
Instances
(Bounded k, Enum k, Ord k, Eq v, Monoid v) => IsList (Map k v) Source # | |
(Eq k, Eq v) => Eq (Map k v) Source # | |
(Bounded k, Enum k, Show k, Show v) => Show (Map k v) Source # | |
(Ord k, Semigroup v, Eq v) => Semigroup (Map k v) Source # | |
(Ord k, Bounded k, Semigroup v, Monoid v, Eq v) => Monoid (Map k v) Source # | |
type Item (Map k v) Source # | |
Defined in Data.Map.Interval.DBTSLL |
:: (Bounded k, Ord k, Enum k, Eq v) | |
=> v | value outside of the ranges |
-> [(k, k, v)] | low-high inclusive ranges with their corresponding values |
-> Map k v |
Create an interval map from a list of range-value triples. The first argument is a default value used everywhere outside of the given ranges. In the case of overlapping ranges, the leftmost value is used.
Mapping
mapBijection :: (v -> w) -> Map k v -> Map k w Source #
Traversals
traverseBijectionP :: PrimMonad m => (v -> m w) -> Map k v -> m (Map k w) Source #
This only provides a correct result when the effectful mapping is a bijection.
traverseBijection :: Applicative m => (v -> m w) -> Map k v -> m (Map k w) Source #
This only provides a correct result when the effectful mapping is a bijection.
Folds
foldlWithKeyM' :: (Bounded k, Enum k, Monad m) => (b -> k -> k -> v -> m b) -> b -> Map k v -> m b Source #
traverse_ :: Applicative m => (v -> m w) -> Map k v -> m () Source #