primitive-containers-0.3.1: containers backed by arrays

Safe HaskellNone
LanguageHaskell2010

Data.Map.Interval.DBTSLL

Contents

Synopsis

Documentation

data Map k v Source #

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 # 
Instance details

Defined in Data.Map.Interval.DBTSLL

Associated Types

type Item (Map k v) :: Type #

Methods

fromList :: [Item (Map k v)] -> Map k v #

fromListN :: Int -> [Item (Map k v)] -> Map k v #

toList :: Map k v -> [Item (Map k v)] #

(Eq k, Eq v) => Eq (Map k v) Source # 
Instance details

Defined in Data.Map.Interval.DBTSLL

Methods

(==) :: Map k v -> Map k v -> Bool #

(/=) :: Map k v -> Map k v -> Bool #

(Bounded k, Enum k, Show k, Show v) => Show (Map k v) Source # 
Instance details

Defined in Data.Map.Interval.DBTSLL

Methods

showsPrec :: Int -> Map k v -> ShowS #

show :: Map k v -> String #

showList :: [Map k v] -> ShowS #

(Ord k, Semigroup v, Eq v) => Semigroup (Map k v) Source # 
Instance details

Defined in Data.Map.Interval.DBTSLL

Methods

(<>) :: Map k v -> Map k v -> Map k v #

sconcat :: NonEmpty (Map k v) -> Map k v #

stimes :: Integral b => b -> Map k v -> Map k v #

(Ord k, Bounded k, Semigroup v, Monoid v, Eq v) => Monoid (Map k v) Source # 
Instance details

Defined in Data.Map.Interval.DBTSLL

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

mconcat :: [Map k v] -> Map k v #

type Item (Map k v) Source # 
Instance details

Defined in Data.Map.Interval.DBTSLL

type Item (Map k v) = (k, k, v)

pure :: Bounded k => v -> Map k v Source #

singleton Source #

Arguments

:: (Bounded k, Enum k, Ord k, Eq v) 
=> v

value outside of the interval

-> k

lower bound

-> k

upper bound

-> v

value inside the interval

-> Map k v 

lookup :: Ord k => k -> Map k v -> v Source #

fromList Source #

Arguments

:: (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.

unionWith :: (Ord k, Eq c) => (a -> b -> c) -> Map k a -> Map k b -> Map k c Source #

Mapping

map :: Eq w => (v -> w) -> Map k v -> Map k w Source #

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

foldl' :: (b -> v -> b) -> b -> Map k v -> b Source #

foldMap :: Monoid m => (v -> m) -> Map k v -> m Source #

foldrWithKey :: (Bounded k, Enum k) => (k -> k -> v -> b -> b) -> b -> Map k v -> b Source #

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 #

Conversion

elems :: Map k v -> Array v Source #