module type Infix = sig ... end
module type Map_and_set_binable = sig ... end
module type Polymorphic_compare = sig ... end
module type S_plain = sig ... end
module type S = sig ... end
module type S_binable = sig ... end
module type S_common = sig ... end
module type Validate = sig ... end
module type With_zero = sig ... end
val lexicographic : ('a -> 'a -> int) list -> 'a -> 'a -> int
lexicographic cmps x y
comparesx
andy
lexicographically using functions in the listcmps
.
val lift : ('a -> 'a -> 'int_or_bool) -> f:('b -> 'a) -> 'b -> 'b -> 'int_or_bool
lift cmp ~f x y
comparesx
andy
by comparingf x
andf y
viacmp
.
val reverse : ('a -> 'a -> 'int_or_bool) -> 'a -> 'a -> 'int_or_bool
reverse cmp x y = cmp y x
Note: The
Comparable.S
interface exports bothascending
anddescending
comparisons, so in most cases, it's better to use those.
module Inherit : functor (C : sig ... end) -> functor (T : sig ... end) -> S with type t := T.t
Inherit comparability from a component.
Comparison-only Functors
module Polymorphic_compare : functor (T : sig ... end) -> Polymorphic_compare with type t := T.t
Make Functors
module Make_plain : functor (T : sig ... end) -> S_plain with type t := T.t
module Make_plain_using_comparator : functor (T : sig ... end) -> S_plain with type t := T.t with type comparator_witness := T.comparator_witness
module Make_using_comparator : functor (T : sig ... end) -> S with type t := T.t with type comparator_witness := T.comparator_witness
module Make_binable : functor (T : sig ... end) -> S_binable with type t := T.t
module Make_binable_using_comparator : functor (T : sig ... end) -> S_binable with type t := T.t with type comparator_witness := T.comparator_witness
module Extend : functor (M : Base.Comparable.S) -> functor (X : sig ... end) -> S with type t := M.t with type comparator_witness := M.comparator_witness
module Extend_binable : functor (M : Base.Comparable.S) -> functor (X : sig ... end) -> S_binable with type t := M.t with type comparator_witness := M.comparator_witness
module Map_and_set_binable : functor (T : sig ... end) -> Map_and_set_binable with type t := T.t
module Map_and_set_binable_using_comparator : functor (T : sig ... end) -> Map_and_set_binable with type t := T.t with type comparator_witness := T.comparator_witness
module Validate_with_zero : functor (T : sig ... end) -> sig ... end
module Stable : sig ... end