Up

module Comparable

: sig
#
module type Infix = Comparable_intf.Infix
#
module type Map_and_set_binable = Comparable_intf.Map_and_set_binable
#
module type S = Comparable_intf.S
#
module type S_binable = Comparable_intf.S_binable
#
module type S_common = Comparable_intf.S_common
#
module type Validate = Comparable_intf.Validate
#
module type With_zero = Comparable_intf.With_zero
#
type 'a bound = 'a Comparable_intf.bound =
# | Incl of 'a
# | Excl of 'a
# | Unbounded
#
val lexicographic : ('a -> 'a -> int) list -> 'a -> 'a -> int

lexicographic cmps x y compares x and y lexicographically using functions in the list cmps.

#
module Inherit : functor (C : sig
#
type t
#
val compare : t -> t -> int
end
) -> functor (T : sig
#
type t
#
val component : t -> C.t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
) -> S with type t := T.t

Inherit comparability from a component.

#
module Make : functor (T : sig
#
type t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val compare : t -> t -> int
end
) -> S with type t := T.t

Usage example:

      module Foo = struct
        module T = struct
          type t = ... with compare, sexp
        end
        include T
        include Comparable.Make (T)
      end

Then include Comparable.S in the signature (see comparable_intf.mli for an example).

#
module Make_binable : functor (T : sig
#
type t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val compare : t -> t -> int
#
val bin_t : t Bin_prot.Type_class.t
#
val bin_read_t : t Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader
#
val bin_reader_t : t Bin_prot.Type_class.reader
#
val bin_size_t : t Bin_prot.Size.sizer
#
val bin_write_t : t Bin_prot.Write.writer
#
val bin_writer_t : t Bin_prot.Type_class.writer
end
) -> S_binable with type t := T.t
#
module Map_and_set_binable : functor (T : sig
#
type t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val compare : t -> t -> int
#
val bin_t : t Bin_prot.Type_class.t
#
val bin_read_t : t Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader
#
val bin_reader_t : t Bin_prot.Type_class.reader
#
val bin_size_t : t Bin_prot.Size.sizer
#
val bin_write_t : t Bin_prot.Write.writer
#
val bin_writer_t : t Bin_prot.Type_class.writer
end
) -> Map_and_set_binable with type t := T.t
#
module Poly : functor (T : sig
#
type t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
) -> S with type t := T.t
#
module Validate : functor (T : sig
#
type t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val compare : t -> t -> int
end
) -> Validate with type t := T.t
#
module With_zero : functor (T : sig
#
type t
#
val zero : t
include Validate with type t := t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val compare : t -> t -> int
end
) -> With_zero with type t := T.t
#
module Validate_with_zero : functor (T : sig
#
type t
#
val zero : t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val compare : t -> t -> int
end
) -> sig
include Validate with type t := T.t
include With_zero with type t := T.t
end
#
module Check_sexp_conversion : functor (M : sig
#
type t
include S with type t := t
#
val examples : t list
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
) -> sig
end
end