Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Documentation
An interval in a poset P.
An interval in a poset P is a subset I of P with the following property:
\( \forall x, y \in I, z \in P: x \leq z \leq y \Rightarrow z \in I \)
Instances
Eq a => Eq (Interval a) Source # | |
Show a => Show (Interval a) Source # | |
Preorder a => Preorder (Interval a) Source # | |
Defined in Data.Order.Interval (<~) :: Interval a -> Interval a -> Bool Source # (>~) :: Interval a -> Interval a -> Bool Source # (?~) :: Interval a -> Interval a -> Bool Source # (~~) :: Interval a -> Interval a -> Bool Source # (/~) :: Interval a -> Interval a -> Bool Source # plt :: Interval a -> Interval a -> Bool Source # pgt :: Interval a -> Interval a -> Bool Source # similar :: Interval a -> Interval a -> Bool Source # pmax :: Interval a -> Interval a -> Maybe (Interval a) Source # pmin :: Interval a -> Interval a -> Maybe (Interval a) Source # pcompare :: Interval a -> Interval a -> Maybe Ordering Source # |
imap :: Preorder b => (a -> b) -> Interval a -> Interval b Source #
Map over an interval.
Note this is not a functor, as a non-monotonic map may cause the interval to collapse to the iempty interval.
(...) :: Preorder a => a -> a -> Interval a infix 3 Source #
Construct an interval from a pair of points.
Note: Endpoints are preorder-sorted. If pcompare x y = Nothing then the resulting interval will be empty.