| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Data.Mapping.Piecewise
Synopsis
- data Piecewise k v = Piecewise {}
- rightEnd :: Piecewise k v -> v
- fromAscList :: Eq v => v -> [(k, v)] -> Piecewise k v
- fromAscListUnsafe :: v -> [(k, v)] -> Piecewise k v
- changeAt :: v -> k -> v -> Piecewise k v
- greaterThanOrEqual :: k -> Piecewise k Bool
- lessThan :: k -> Piecewise k Bool
- greaterThan :: Enum k => k -> Piecewise k Bool
- lessThanOrEqual :: Enum k => k -> Piecewise k Bool
- innerMerge :: Ord k => (x -> y -> z) -> x -> y -> [(k, x)] -> [(k, y)] -> [(k, z)]
- innerMergeA :: (Ord k, Applicative f) => (x -> y -> f z) -> x -> y -> [(k, x)] -> [(k, y)] -> f [(k, z)]
- innerMerge3 :: Ord k => (x -> y -> z -> w) -> x -> y -> z -> [(k, x)] -> [(k, y)] -> [(k, z)] -> [(k, w)]
- innerMergeA3 :: (Applicative f, Ord k) => (x -> y -> z -> f w) -> x -> y -> z -> [(k, x)] -> [(k, y)] -> [(k, z)] -> f [(k, w)]
- mapKeysMonotonic :: (k -> l) -> Piecewise k v -> Piecewise l v
- mapKeysAntitonic :: (k -> l) -> Piecewise k v -> Piecewise l v
- splitPiecewise :: Ord k => k -> Piecewise k v -> (Piecewise k v, Piecewise k v)
- gluePiecewise :: Eq v => Piecewise k v -> k -> Piecewise k v -> Piecewise k v
Documentation
A data structure storing mappings that are constant on intervals.
If the space of keys not discrete, then these mappings are right-continuous: values are in general defined on intervals $a leq x < b$ which are closed on the left and open on the right.
Constructors
| Piecewise | |
Instances
fromAscList :: Eq v => v -> [(k, v)] -> Piecewise k v Source #
Assumes the keys are distinct and increasing (but consecutive values may be the same, in which case the intervening keys are removed)
fromAscListUnsafe :: v -> [(k, v)] -> Piecewise k v Source #
Assumes that the keys are distinct and increasing, and also that consecutive values are distinct
greaterThanOrEqual :: k -> Piecewise k Bool Source #
Is the value greater than or equal to k?
greaterThan :: Enum k => k -> Piecewise k Bool Source #
Is the value greater than k? This is subject to the usual
concerns about Enum (it not to be used with floating-point
arithmetic, for example)
lessThanOrEqual :: Enum k => k -> Piecewise k Bool Source #
Is the value less than or equal to k? This is subject to the
usual concerns about Enum (it not to be used with floating-point
arithmetic, for example)
innerMerge :: Ord k => (x -> y -> z) -> x -> y -> [(k, x)] -> [(k, y)] -> [(k, z)] Source #
innerMergeA :: (Ord k, Applicative f) => (x -> y -> f z) -> x -> y -> [(k, x)] -> [(k, y)] -> f [(k, z)] Source #
innerMerge3 :: Ord k => (x -> y -> z -> w) -> x -> y -> z -> [(k, x)] -> [(k, y)] -> [(k, z)] -> [(k, w)] Source #
innerMergeA3 :: (Applicative f, Ord k) => (x -> y -> z -> f w) -> x -> y -> z -> [(k, x)] -> [(k, y)] -> [(k, z)] -> f [(k, w)] Source #
mapKeysMonotonic :: (k -> l) -> Piecewise k v -> Piecewise l v Source #
Alter keys according to a function, assumed to be monotone (not checked)
mapKeysAntitonic :: (k -> l) -> Piecewise k v -> Piecewise l v Source #
Alter keys according to a function, assumed to be antitone (not checked)