hgeometry-0.5.0.0: Geometric Algorithms, Data structures, and Data types.

Data.Geometry.Interval

Synopsis

Documentation

newtype Interval a r Source

An Interval is essentially a Range but with possible payload

Constructors

 GInterval Fields_unInterval :: Range (r :+ a)

Instances

 Source Source Source Source (Eq a, Eq r) => Eq (Interval a r) Source (Show a, Show r) => Show (Interval a r) Source HasEnd (Interval a r) Source HasStart (Interval a r) Source Ord r => IsIntersectableWith (Interval a r) (Interval a r) Source type NumType (Interval a r) = r Source type Dimension (Interval a r) = 1 Source type EndCore (Interval a r) = r Source type EndExtra (Interval a r) = a Source type StartCore (Interval a r) = r Source type StartExtra (Interval a r) = a Source type IntersectionOf (Interval a r) (Interval a r) = (:) * NoIntersection ((:) * (Interval a r) ([] *)) Source

unInterval :: forall a r a r. Iso (Interval a r) (Interval a r) (Range ((:+) r a)) (Range ((:+) r a)) Source

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.

pattern OpenInterval :: (:+) r a -> (:+) r a -> Interval a r Source

pattern ClosedInterval :: (:+) r a -> (:+) r a -> Interval a r Source

pattern Interval :: EndPoint ((:+) r a) -> EndPoint ((:+) r a) -> Interval a r Source

class HasStart t where Source

Associated Types

type StartCore t Source

type StartExtra t Source

Methods

Instances

 HasStart (Interval a r) Source HasStart (HalfLine d r) Source HasStart (LineSegment d p r) Source

class HasEnd t where Source

Associated Types

type EndCore t Source

type EndExtra t Source

Methods

end :: Lens' t (EndCore t :+ EndExtra t) Source

Instances

 HasEnd (Interval a r) Source HasEnd (LineSegment d p r) Source

shiftLeft' :: Num r => r -> Interval a r -> Interval a r Source