Pull back a comparator by a function f, by applying the comparator to both arguments.
Equations
- Ordering.byKey f cmp a b = cmp (f a) (f b)
Instances For
TotalBLE le asserts that le has a total order, that is, le a b ∨ le b a.
- total {a b : α} : le a b = true ∨ le b a = true
leis total: eitherle a borle b a.
Instances
Batteries features not in core Std
LawfulLTCmp cmp asserts that cmp x y = .lt and x < y coincide.
- eq_lt_iff_lt {x y : α} : cmp x y = Ordering.lt ↔ x < y
cmp x y = .ltholds iffx < yis true.
Instances
LawfulLECmp cmp asserts that (cmp x y).isLE and x ≤ y coincide.
- isLE_iff_le {x y : α} : (cmp x y).isLE = true ↔ x ≤ y
cmp x y ≠ .gtholds iffx ≤ yis true.
Instances
LawfulBCmp cmp asserts that the LE, LT, BEq are all coherent with each other
and with cmp, describing a strict weak order (a linear order except for antisymmetry).
Instances
LawfulBCmp cmp asserts that the LE, LT, Eq are all coherent with each other
and with cmp, describing a linear order.
Instances
Class for types where the ordering function is compatible with the LT.
Equations
- Std.LawfulLTOrd α = Std.LawfulLTCmp compare
Instances For
Class for types where the ordering function is compatible with the LE.
Equations
- Std.LawfulLEOrd α = Std.LawfulLECmp compare
Instances For
Class for types where the ordering function is compatible with the LE, LT and BEq.
Equations
- Std.LawfulBOrd α = Std.LawfulBCmp compare
Instances For
Class for types where the ordering function is compatible with the LE, LT and Eq.
Equations
- Std.LawfulOrd α = Std.LawfulCmp compare