Order
A type class for total orders on values of type A.
compare returns a negative number, zero or a positive number when a is less than, equivalent to or greater than b. Equivalence (eqv) is defined as compare(a, b) == 0.
Laws (in addition to the Eq laws):
Reflexivity:
lteqv(a, a)Antisymmetry:
lteqv(a, b) && lteqv(b, a)implieseqv(a, b)Transitivity:
lteqv(a, b) && lteqv(b, c)implieslteqv(a, c)Totality:
lteqv(a, b) || lteqv(b, a)
Int.order.max(1, 2) // 2
Maybe.order(Int.order).lt(Maybe.None(), Maybe.Just(0)) // trueContent copied to clipboard