Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype Interval a r = GInterval {
- _unInterval :: Range (r :+ a)
- pattern OpenInterval :: forall r a. (:+) r a -> (:+) r a -> Interval a r
- pattern ClosedInterval :: forall r a. (:+) r a -> (:+) r a -> Interval a r
- pattern Interval :: forall r a. EndPoint ((:+) r a) -> EndPoint ((:+) r a) -> Interval a r
- class HasStart t where
- type StartCore t
- type StartExtra t
- class HasEnd t where
- inInterval :: Ord r => r -> Interval a r -> Bool
- shiftLeft' :: Num r => r -> Interval a r -> Interval a r
- module Data.Range
1 dimensional Intervals
An Interval is essentially a Range
but with possible payload
GInterval | |
|
Bifunctor Interval Source # | |
Functor (Interval a) Source # | |
Foldable (Interval a) Source # | |
Traversable (Interval a) Source # | |
(Eq r, Eq a) => Eq (Interval a r) Source # | |
(Show a, Show r) => Show (Interval a r) Source # | |
Generic (Interval a r) Source # | |
(NFData a, NFData r) => NFData (Interval a r) Source # | |
HasEnd (Interval a r) Source # | |
HasStart (Interval a r) Source # | |
IntervalLike (Interval p r) Source # | |
Ord r => IsIntersectableWith (Interval a r) (Interval a r) Source # | |
type Rep (Interval a r) Source # | |
type NumType (Interval a r) Source # | |
type Dimension (Interval a r) Source # | |
type EndCore (Interval a r) Source # | |
type EndExtra (Interval a r) Source # | |
type StartCore (Interval a r) Source # | |
type StartExtra (Interval a r) Source # | |
type IntersectionOf (Interval a r) (Interval a r) Source # | |
querying the start and end of intervals
Working with intervals
inInterval :: Ord r => r -> Interval a r -> Bool Source #
Test if a value lies in an interval. Note that the difference between inInterval and inRange is that the extra value is *not* used in the comparison with inInterval, whereas it is in inRange.
module Data.Range