Portability | portable |
---|---|
Stability | experimental |
Maintainer | chbreitkopf@gmail.com |
Safe Haskell | Safe-Inferred |
- class Ord e => Interval i e | i -> e where
- lowerBound, upperBound :: i -> e
- leftClosed :: i -> Bool
- rightClosed :: i -> Bool
- overlaps, after, before, subsumes :: i -> i -> Bool
- above, inside, below :: e -> i -> Bool
- isEmpty :: i -> Bool
- genericEquals :: (Interval i e, Eq e) => i -> i -> Bool
- genericCompare :: (Interval i e, Ord e) => i -> i -> Ordering
Interval type
class Ord e => Interval i e | i -> e whereSource
Intervals with endpoints of type e
.
A minimal instance declaration needs to define con
, lowerBound
, and upperBound
.
lowerBound, upperBound :: i -> eSource
lower and upper bound
leftClosed :: i -> BoolSource
Does the interval include its lower bound? Default is True for all values, i.e. closed intervals.
rightClosed :: i -> BoolSource
Does the interval include its upper bound bound? Default is True for all values, i.e. closed intervals.
overlaps, after, before, subsumes :: i -> i -> BoolSource
helper functions for declaring Eq and Ord instances
genericEquals :: (Interval i e, Eq e) => i -> i -> BoolSource
genericCompare :: (Interval i e, Ord e) => i -> i -> OrderingSource