Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Interval a r = GInterval {
- _unInterval :: Range (r :+ a)
- pattern OpenInterval :: (r :+ a) -> (r :+ a) -> Interval a r
- pattern ClosedInterval :: (r :+ a) -> (r :+ a) -> Interval a r
- pattern Interval :: 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 | |
|
Instances
querying the start and end of intervals
class HasStart t where Source #
Instances
HasStart (Interval a r) Source # | |
HasStart (HalfLine d r) Source # | |
HasStart (LineSegment d p r) Source # | |
Defined in Data.Geometry.LineSegment type StartCore (LineSegment d p r) :: * Source # type StartExtra (LineSegment d p r) :: * Source # start :: Lens' (LineSegment d p r) (StartCore (LineSegment d p r) :+ StartExtra (LineSegment d p r)) Source # |
Instances
HasEnd (Interval a r) Source # | |
HasEnd (LineSegment d p r) Source # | |
Defined in Data.Geometry.LineSegment type EndCore (LineSegment d p r) :: * Source # type EndExtra (LineSegment d p r) :: * Source # end :: Lens' (LineSegment d p r) (EndCore (LineSegment d p r) :+ EndExtra (LineSegment d p r)) Source # |
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