module type Infix = Base__Comparable_intf.Infix
module type S = Base__Comparable_intf.S
module type Polymorphic_compare = Base__Comparable_intf.Polymorphic_compare
module type Validate = Base__Comparable_intf.Validate
module type With_zero = Base__Comparable_intf.With_zero
lexicographic cmps x y
compares x
and y
lexicographically using functions in the list cmps
.
lift cmp ~f x y
compares x
and y
by comparing f x
and f y
via cmp
.
reverse cmp x y = cmp y x
Reverses the direction of asymmetric relations by swapping their arguments. Useful, e.g., for relations implementing "is a subset of" or "is a descendant of".
Where reversed relations are already provided, use them directly. For example, Comparable.S
provides ascending
and descending
, which are more readable as a pair than compare
and reverse compare
. Similarly, <=
is more idiomatic than reverse (>=)
.
Inherit comparability from a component.
module Make_using_comparator : functor (T : sig ... end) -> S with type t := T.t with type comparator_witness := T.comparator_witness
module Validate_with_zero : functor (T : sig ... end) -> sig ... end