Linear Orderings
Linear orderings provide a strict order. The laws for (<=) for
all a,b,c:
reflexivity:
a \leq aantisymmetry:
(a \leq b) \land (b \leq a) \rightarrow (a = b)transitivity:
(a \leq b) \land (b \leq c) \rightarrow (a \leq c)
and these "agree" with <:
x <= y=not (y > x)x >= y=not (y < x)
Unlike in the non-linear setting, a linear compare doesn't follow from
<= since it requires calls: one to <= and one to ==. However,
from a linear compare it is easy to implement the others. Hence, the
minimal complete definition only contains compare.
Methods
compare :: a %1 -> a %1 -> Orderinginfix 4compare x yreturns anOrderingwhich is one ofGT(greater than),EQ(equal), orLT(less than) which should be understood as "x is(compare x y)y".(<=) :: a %1 -> a %1 -> Boolinfix 4(<) :: a %1 -> a %1 -> Boolinfix 4(>) :: a %1 -> a %1 -> Boolinfix 4(>=) :: a %1 -> a %1 -> Boolinfix 4
Instances22Ord, …
Ord Int16Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd Int32Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd Int64Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd Int8Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd Word16Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd Word32Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd Word64Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd Word8Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd BoolDefined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd CharDefined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd DoubleDefined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd IntDefined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd OrderingDefined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd ()Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.OrdOrd a => Ord (Ur a)Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord(Ord a, Movable a) => Ord (MovableOrd a)Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord(Consumable a, Ord a) => Ord (Maybe a)Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord(Consumable a, Ord a) => Ord [a]Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord(Ord a, Ord b) => Ord (a, b)Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord(Consumable a, Consumable b, Ord a, Ord b) => Ord (Either a b)Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord(Ord a, Ord b, Ord c) => Ord (a, b, c)Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)Defined in linear-base-0.4.0 · Data.Ord.Linear.Internal.Ord