Core_kernel.Tuple
Functors and signatures for dealing with modules for tuples.
module T2 : sig ... end
Signature for a 2-tuple module
module T3 : sig ... end
Signature for a 3-tuple module
These functors allow users to write:
module Foo = struct
include Tuple.Make (String) (Int)
include Tuple.Comparable (String) (Int)
include Tuple.Hashable (String) (Int)
include Tuple.Binable (String) (Int)
end
module type Comparable_sexpable = sig ... end
module Comparable_plain (S1 : Comparable.S_plain) (S2 : Comparable.S_plain) : sig ... end
module Comparable (S1 : Comparable_sexpable) (S2 : Comparable_sexpable) : Comparable_sexpable with type t := Make(S1)(S2).t
module type Hashable_sexpable = sig ... end
module Hashable (S1 : Hashable_sexpable) (S2 : Hashable_sexpable) : Hashable_sexpable with type t := Make(S1)(S2).t
The difference between Hashable
and Hashable_t
functors is that the former's result type doesn't contain type t
and the latter does. Therefore, Hashable
can't be used to combine two pairs into 4-tuple. but Hashable_t
can. On the other hand result of Hashable_t
cannot be combined with Comparable
.
module Hashable_t (S1 : Hashable_sexpable) (S2 : Hashable_sexpable) : Hashable_sexpable with type t = Make(S1)(S2).t
module Sexpable (S1 : Sexpable.S) (S2 : Sexpable.S) : Sexpable.S with type t := Make(S1)(S2).t
module Hasher (H1 : sig ... end) (H2 : sig ... end) : Hashable_sexpable with type t := Make(H1)(H2).t