Module Base.Comparable
module type Infix = Base__.Comparable_intf.Infixmodule type S = Base__.Comparable_intf.Smodule type Validate = Base__.Comparable_intf.Validatemodule type With_zero = Base__.Comparable_intf.With_zeroval lexicographic : ('a -> 'a -> int) list -> 'a -> 'a -> intlexicographic cmps x ycomparesxandylexicographically using functions in the listcmps.
val lift : ('a -> 'a -> 'result) -> f:('b -> 'a) -> 'b -> 'b -> 'resultlift cmp ~f x ycomparesxandyby comparingf xandf yviacmp.
val reverse : ('a -> 'a -> 'result) -> 'a -> 'a -> 'resultreverse cmp x y = cmp y xReverses 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.Sprovidesascendinganddescending, which are more readable as a pair thancompareandreverse compare. Similarly,<=is more idiomatic thanreverse (>=).
val equal : ('a -> 'a -> int) -> 'a -> 'a -> boolval max : ('a -> 'a -> int) -> 'a -> 'a -> 'aval min : ('a -> 'a -> int) -> 'a -> 'a -> 'a
module Polymorphic_compare : functor (T : sig ... end) -> Polymorphic_compare with type t := T.tmodule Inherit : functor (C : sig ... end) -> functor (T : sig ... end) -> S with type t := T.tInherit comparability from a component.
module Make_using_comparator : functor (T : sig ... end) -> S with type t := T.t with type comparator_witness := T.comparator_witnessmodule Validate_with_zero : functor (T : sig ... end) -> sig ... end