Safe Haskell | Safe-Inferred |
---|

Discrete Interval Encoding Tree described by Martin Erwig in *Diets for Fat Sets, January 1993*.

- data Interval a
- point :: a -> Interval a
- interval :: Ord a => a -> a -> Interval a
- intervalMin :: Interval a -> a
- intervalMax :: Interval a -> a
- mergeI :: (Ord a, Enum a) => Interval a -> Interval a -> Maybe (Interval a)
- isPointed :: Eq a => Interval a -> Bool
- mapI :: Ord b => (a -> b) -> Interval a -> Interval b
- data Diet a
- member :: Ix a => a -> Diet a -> Bool
- notMember :: Ix a => a -> Diet a -> Bool
- insert :: (Ord a, Enum a) => a -> Diet a -> Diet a
- delete :: (Ord a, Enum a) => a -> Diet a -> Diet a
- empty :: Diet a
- single :: a -> Diet a
- singleI :: Interval a -> Diet a
- size :: Ix a => Diet a -> Int
- diet :: (b -> Interval a -> b -> b) -> b -> Diet a -> b
- toList :: Ix a => Diet a -> [a]
- fromList :: (Foldable t, Ord a, Enum a) => t a -> Diet a
- mapD :: Ord b => (a -> b) -> Diet a -> Diet b

# Documentation

An interval with discrete values between.

interval :: Ord a => a -> a -> Interval aSource

Construct an interval ensuring that the minimum is less than or equal to maximum.

intervalMin :: Interval a -> aSource

The minimum of the interval.

intervalMax :: Interval a -> aSource

The maximum of the interval.

mergeI :: (Ord a, Enum a) => Interval a -> Interval a -> Maybe (Interval a)Source

Merge two intervals if they are overlapping or adjacent.

isPointed :: Eq a => Interval a -> BoolSource

Returns whether or not the interval has the same minimum and maximum.

mapI :: Ord b => (a -> b) -> Interval a -> Interval bSource

Map a function across the minimum and maximum of the interval.

A Discrete Interval Encoding Tree.