A type-indexed value that allows one to compare (and for generating error messages, serialize) values of the type in question.

One of the type parameters is a phantom parameter used to distinguish comparators potentially built on different comparison functions. In particular, we want to distinguish those using polymorphic compare and those using a monomorphic compare.

type ('a, 'witness) t = private {
compare : 'a -> 'a -> int;
sexp_of_t : 'a -> Sexplib.Sexp.t;
type ('a, 'b) comparator = ('a, 'b) t
module type S = sig .. end
type t
type comparator_witness
val comparator : (t, comparator_witness) comparator
module type S1 = sig .. end
type 'a t
type comparator_witness
val comparator : ('a t, comparator_witness) comparator
module Poly : S1 with type t = 'a
module S_to_S1 : 
functor (S : S) -> S1 with type t = S.t with type comparator_witness = S.comparator_witness
The Make functors mint fresh types that are used as the phantom comparator_witnesses.
module Make : 
functor (M : sig .. end) -> S with type t := M.t
module Make1 : 
functor (M : sig .. end) -> S1 with type t := 'a M.t