Higher_kindedThis library allows you to use higher-kinded types in OCaml. See the README for a short tutorial on what that means and how to use it.
If A implements the signature S2, (a, b, A.witness2) t2 is equivalent to (a, b) A.t.
If A implements the signature S3, (a, b, c, A.witness3) t3 is equivalent to (a, b, c) A.t.
If A implements the signature S4, (a, b, c, d, A.witness4) t4 is equivalent to (a, b, c, d) A.t.
If A implements the signature S5, (a, b, c, d, e, A.witness5) t5 is equivalent to (a, b, c, d, e) A.t.
If A implements the signature S6, (a, b, c, d, e, f, A.witness6) t6 is equivalent to (a, b, c, d, e, f) A.t.
If A implements the signature S7, (a, b, c, d, e, f, g, A.witness7) t7 is equivalent to (a, b, c, d, e, f, g) A.t.
type ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'witness) t8 =
('a, 'b, 'c, 'd, 'e, 'f, 'g, ('h, 'witness) t) t7If A implements the signature S8, (a, b, c, d, e, f, g, h, A.witness8) t8 is equivalent to (a, b, c, d, e, f, g, h) A.t.
These are the signatures implemented by the Make family of functors.
module type S = sig ... endmodule type S2 = sig ... endmodule type S3 = sig ... endmodule type S4 = sig ... endmodule type S5 = sig ... endmodule type S6 = sig ... endmodule type S7 = sig ... endmodule type S8 = sig ... endThis is the meat of the library. Use these functors to implement the higher_kinded interface.
Base, Core, and Async don't depend on Higher_kinded, so we put these implementations here instead of in the respective modules where they might have been a nicer fit.
module Array : S with type 'a t := 'a Base.Array.tmodule Either : S2 with type ('a, 'b) t := ('a, 'b) Base.Either.tmodule Hash_set : S with type 'a t := 'a Base.Hash_set.tmodule Hashtbl : S2 with type ('a, 'b) t := ('a, 'b) Base.Hashtbl.tmodule Lazy : S with type 'a t := 'a Base.Lazy.tmodule List : S with type 'a t := 'a Base.List.tmodule Map : S3 with type ('a, 'b, 'c) t := ('a, 'b, 'c) Base.Map.tmodule Option : S with type 'a t := 'a Base.Option.tmodule Queue : S with type 'a t := 'a Base.Queue.tmodule Ref : S with type 'a t := 'a Base.Ref.tmodule Result : S2 with type ('a, 'e) t := ('a, 'e) Base.Result.tmodule Set : S2 with type ('a, 'b) t := ('a, 'b) Base.Set.tmodule Sequence : S with type 'a t := 'a Base.Sequence.tmodule Type_equal : S2 with type ('a, 'b) t := ('a, 'b) Base.Type_equal.tt itself has two type parameters, so we might as well implement S2 right here.