Transformation for include functor in standard OCaml.
Attempts to imitate OxCaml include functor.
opam pin git+https://github.com/sim642/ppx_include_functor.gitIn dune:
(preprocess (pps ppx_include_functor))
Use [%%functor include Comparable.Make] as a module item instead of include functor Comparable.Make.
For example,
module M = struct
type t = ...
[@@deriving compare, sexp]
[%%functor include Comparable.Make]
endis transformed (roughly) into
module M = struct
module T = struct
type t = ...
[@@deriving compare, sexp]
end
include T
include Comparable.Make(T)
endUnlike in OxCaml:
- Auxiliary module
Include_functor_*(likeT) is exposed. - Generative functors are not supported.
- Not supported in module signatures.