Module Core_kernel.Comparator
Extends Base.Comparator
, providing a type-indexed value that allows you to compare values of that type.
type ('a, 'witness) t
= private ('a, 'witness) Base.Comparator.t
=
{
compare : 'a -> 'a -> Core_kernel__.Import.int;
sexp_of_t : 'a -> Base.Sexp.t;
}
include module type of Base.Comparator with type ('a, 'witness) Comparator.t := ('a, 'witness) t
type ('a, 'witness) t
= private
{
compare : 'a -> 'a -> int;
sexp_of_t : 'a -> Base.Sexp.t;
}
type ('a, 'b) comparator
= ('a, 'b) t
module type S = sig ... end
module type S1 = sig ... end
module type S_fc = sig ... end
val make : compare:('a -> 'a -> int) -> sexp_of_t:('a -> Base.Sexp.t) -> (module S_fc with type comparable_t = 'a)
make
creates a comparator witness for the given comparison. It is intended as a lightweight alternative to the functors below, to be used like so:include (val Comparator.make ~compare ~sexp_of_t)
module Poly = Base.Comparator.Poly
module S_to_S1 = Base.Comparator.S_to_S1
module Make = Base.Comparator.Make
Make
creates acomparator
value and its phantomcomparator_witness
type for a nullary type.
module Make1 = Base.Comparator.Make1
Make1
creates acomparator
value and its phantomcomparator_witness
type for a unary type. It takes acompare
andsexp_of_t
that have non-standard types because theComparator.t
type doesn't allow passing in additional values for the type argument.
module type Derived = sig ... end
module Derived = Base.Comparator.Derived
Derived
creates acomparator
function that constructs a comparator for the type'a t
given a comparator for the type'a
.
module type Derived2 = sig ... end
module Derived2 = Base.Comparator.Derived2
Derived2
creates acomparator
function that constructs a comparator for the type('a, 'b) t
given comparators for the type'a
and'b
.
module type Derived_phantom = sig ... end
module Derived_phantom = Base.Comparator.Derived_phantom
Derived_phantom
creates acomparator
function that constructs a comparator for the type('a, 'b) t
given a comparator for the type'a
.
module Stable : sig ... end