Summary: Generic functions for comparing two values in different ways.
The fundamental function here is compare, a function that returns the
Ordering of two values (less than, equal to, or greater than). It uses the
same lexicographical ordering as deriving Ord (e.g. left alternative of a
sum is less than the right alternative, the first component of a product is
compared first while the second is only compared if the first is equal,
All of the remaining functions are simply derived (in the most obvious way)
from compare. All of these functions are equivalent to methods in the Eq
and Ord type classes. The difference with using this approach vs. deriving
(Eq, Ord) is that you can write ad-hoc cases for certain datatypes while
most of the functionality is handled generically.
|compare is equivalent to the function of the same name when deriving
Ord. All other comparison functions in this module are derived from
|The type of a generic function that takes two values of the same type and
returns an Ordering.
|Compare two values and return an Ordering (i.e. LT, GT, or EQ).
This is implemented exactly as if the datatype was deriving Ord.
|These functions are equivalent to (==) and (/=) when deriving Eq.
|Equal to. Returns x == y.
|Not equal to. Returns x /= y.
|Less than, greater than
|These functions are equivalent to (<), (<=), (>), and (>=) when
|Less than. Returns x < y.
|Less than or equal to. Returns x <= y.
|Greater than. Returns x > y.
|Greater than or equal to. Returns x >= y.
|Minimum and maximum
|These functions are equivalent to functions of the same name when
|The minimum of two values.
|The maximum of two values.
|Produced by Haddock version 2.4.2|