diff --git a/CHANGES.md b/CHANGES.md index 551d12f499..423f94a2e7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,8 @@ - Support for OxCaml zero alloc definitions (@Leonidas-from-XIV, #1422, #1444) - Remove requirement for ppx_expect in tests (@jonludlam, #1445) - Support for OxCaml modalities (@art-w, #1420) +- Display items included via `include functor` as included via the functor + (@Leonidas-from-XIV, #1452) # 3.2.1 diff --git a/src/document/generator.ml b/src/document/generator.ml index 0133714b0f..6d840e3d89 100644 --- a/src/document/generator.ml +++ b/src/document/generator.ml @@ -1916,8 +1916,8 @@ module Make (Syntax : SYNTAX) = struct and include_ (t : Odoc_model.Lang.Include.t) = let decl_hidden = match t.decl with - | Alias p -> Paths.Path.(is_hidden (p :> t)) - | ModuleType mty -> umty_hidden mty + | Alias p | Functor (Path p) -> Paths.Path.(is_hidden (p :> t)) + | ModuleType mty | Functor (ModuleType mty) -> umty_hidden mty in let status = if decl_hidden then `Inline else t.status in @@ -1925,14 +1925,18 @@ module Make (Syntax : SYNTAX) = struct let summary = if decl_hidden then O.render (O.keyword "include" ++ O.txt " ...") else - let include_decl = + let include_kw, include_decl = match t.decl with | Odoc_model.Lang.Include.Alias mod_path -> - Link.from_path (mod_path :> Paths.Path.t) - | ModuleType mt -> umty mt + (O.keyword "include", Link.from_path (mod_path :> Paths.Path.t)) + | Functor (Path mod_path) -> + ( O.keyword "include functor", + Link.from_path (mod_path :> Paths.Path.t) ) + | Functor (ModuleType mt) -> (O.keyword "include functor", umty mt) + | ModuleType mt -> (O.keyword "include", umty mt) in O.render - (O.keyword "include" ++ O.txt " " ++ include_decl + (include_kw ++ O.txt " " ++ include_decl ++ if Syntax.Mod.include_semicolon then O.keyword ";" else O.noop) in let content = { Include.content; status; summary } in diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 7de18c4296..94dc3d9fb9 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -613,26 +613,29 @@ and read_include env parent incl = let decl_modty = #if defined OXCAML match unwrap_module_expr_desc incl.incl_mod.mod_desc, incl.incl_kind with - | _, (Tincl_functor _ | Tincl_gen_functor _) -> - (* TODO: Handle [include functor] *) - None + | Tmod_ident (p, _), (Tincl_functor _ | Tincl_gen_functor _) -> ( + let p = Env.Path.read_module env.ident_env p in + Some (`Functor p)) | Tmod_ident(p, _), Tincl_structure -> #else match unwrap_module_expr_desc incl.incl_mod.mod_desc with | Tmod_ident(p, _) -> #endif let p = Env.Path.read_module env.ident_env p in - Some (ModuleType.U.TypeOf (ModuleType.StructInclude p, p)) + Some (`Module_type (ModuleType.U.TypeOf (ModuleType.StructInclude p, p))) | _ -> let mty = read_module_expr env parent container incl.incl_mod in - umty_of_mty mty + umty_of_mty mty |> Option.map (fun m -> `Module_type m) in let content, shadowed = Cmi.read_signature_noenv env parent (Odoc_model.Compat.signature incl.incl_type) in let expansion = { content; shadowed; } in match decl_modty with - | Some m -> + | Some `Module_type m -> let decl = ModuleType m in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] + | Some `Functor p -> + let decl = Include.Functor (Path p) in + [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] | _ -> content.items diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index a5200ae3b5..33ef7cc95a 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -965,8 +965,16 @@ and read_include env parent incl = #endif let decl = Include.ModuleType uexpr in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] +#if defined OXCAML + | Some uexpr, (Tincl_functor _ | Tincl_gen_functor _) -> + let decl = match uexpr with + | TypeOf (ModPath p, _) -> Include.Functor (Path p) + | Path p -> Include.Functor (ModuleType uexpr) + | _ -> failwith "We expected TypeOf or Path but got something else" + in + [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] +#endif | _ -> - (* TODO: Handle [include functor] *) content.items and read_open env parent o = diff --git a/src/model/lang.ml b/src/model/lang.ml index 4fe5b890ae..b791592c79 100644 --- a/src/model/lang.ml +++ b/src/model/lang.ml @@ -195,8 +195,13 @@ and Include : sig type expansion = { shadowed : shadowed; content : Signature.t } + type functor' = Path of Path.Module.t | ModuleType of ModuleType.U.expr + (* Explicitly unexpanded decl *) - type decl = Alias of Path.Module.t | ModuleType of ModuleType.U.expr + type decl = + | Alias of Path.Module.t + | ModuleType of ModuleType.U.expr + | Functor of functor' type t = { loc : Location_.span; @@ -632,7 +637,9 @@ let extract_signature_doc (s : Signature.t) = (* A signature that starts with an include may inherits the top-comment from the expansion. *) | { Include.status = `Inline; _ } -> true - | { decl = Alias p; _ } -> Paths.Path.is_hidden (p :> Path.t) + | { decl = Alias p; _ } | { decl = Functor (Path p); _ } -> + Paths.Path.is_hidden (p :> Path.t) + | { decl = Functor (ModuleType expr); _ } -> uexpr_considered_hidden expr | { decl = ModuleType expr; _ } -> uexpr_considered_hidden expr in match (s.doc, s.items) with diff --git a/src/model_desc/lang_desc.ml b/src/model_desc/lang_desc.ml index 75e9bcf7e3..103ba28239 100644 --- a/src/model_desc/lang_desc.ml +++ b/src/model_desc/lang_desc.ml @@ -293,6 +293,8 @@ and include_decl = Variant (function | Alias p -> C ("Alias", (p :> Paths.Path.t), path) + | Functor (Path p) -> C ("Functor", (p :> Paths.Path.t), path) + | Functor (ModuleType e) -> C ("Functor", e, moduletype_u_expr) | ModuleType e -> C ("ModuleType", e, moduletype_u_expr)) and include_expansion = diff --git a/src/xref2/compile.ml b/src/xref2/compile.ml index a6dd9a101d..dbb4b386f3 100644 --- a/src/xref2/compile.ml +++ b/src/xref2/compile.ml @@ -389,6 +389,10 @@ and include_decl : Env.t -> Id.Signature.t -> Include.decl -> Include.decl = | ModuleType expr -> if is_elidable_with_module_type_u expr then ModuleType expr else ModuleType (u_module_type_expr env id expr) + | Functor (Path p) -> Functor (Path (module_path env p)) + | Functor (ModuleType expr) -> + if is_elidable_with_module_type_u expr then ModuleType expr + else Functor (ModuleType (u_module_type_expr env id expr)) | Alias p -> Alias (module_path env p) and module_type : Env.t -> ModuleType.t -> ModuleType.t = @@ -410,10 +414,16 @@ and include_ : Env.t -> Include.t -> Include.t * Env.t = match let open Odoc_utils.ResultMonad in match decl with + | Functor (Path p) -> + Tools.expansion_of_module_path env ~strengthen:true p >>= fun exp -> + Tools.assert_functor exp + | Functor (ModuleType mty) -> + Tools.signature_of_u_module_type_expr env mty ~allow_functor:true | Alias p -> Tools.expansion_of_module_path env ~strengthen:true p >>= fun exp -> Tools.assert_not_functor exp - | ModuleType mty -> Tools.signature_of_u_module_type_expr env mty + | ModuleType mty -> + Tools.signature_of_u_module_type_expr env mty ~allow_functor:false with | Error e -> Errors.report ~what:(`Include decl) ~tools_error:e `Expand; @@ -639,7 +649,9 @@ and module_type_map_subs env id cexpr subs = match find_parent cexpr with | None -> None | Some parent -> ( - match Tools.signature_of_u_module_type_expr env cexpr with + match + Tools.signature_of_u_module_type_expr env cexpr ~allow_functor:false + with | Error e -> Errors.report ~what:(`Module_type id) ~tools_error:e `Lookup; None diff --git a/src/xref2/component.ml b/src/xref2/component.ml index be23a7b3ea..e26874737d 100644 --- a/src/xref2/component.ml +++ b/src/xref2/component.ml @@ -364,7 +364,11 @@ end = Open and Include : sig - type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr + type functor' = Path of Cpath.module_ | ModuleType of ModuleType.U.expr + type decl = + | Alias of Cpath.module_ + | ModuleType of ModuleType.U.expr + | Functor of functor' type t = { parent : Odoc_model.Paths.Identifier.Signature.t; @@ -924,6 +928,9 @@ module Fmt = struct let open Include in function | Alias p -> Format.fprintf ppf "%a" (module_path c) p + | Functor (Path p) -> Format.fprintf ppf "functor %a" (module_path c) p + | Functor (ModuleType mt) -> + Format.fprintf ppf "functor %a" (u_module_type_expr c) mt | ModuleType mt -> Format.fprintf ppf "%a" (u_module_type_expr c) mt and value c ppf v = @@ -2410,6 +2417,9 @@ module Of_Lang = struct and include_decl ident_map m = match m with | Odoc_model.Lang.Include.Alias p -> Include.Alias (module_path ident_map p) + | Functor (Path p) -> Functor (Path (module_path ident_map p)) + | Functor (ModuleType s) -> + Functor (ModuleType (u_module_type_expr ident_map s)) | ModuleType s -> ModuleType (u_module_type_expr ident_map s) and simple_expansion ident_map diff --git a/src/xref2/component.mli b/src/xref2/component.mli index abda54e140..8a3a92a03d 100644 --- a/src/xref2/component.mli +++ b/src/xref2/component.mli @@ -336,7 +336,11 @@ and Open : sig end and Include : sig - type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr + type functor' = Path of Cpath.module_ | ModuleType of ModuleType.U.expr + type decl = + | Alias of Cpath.module_ + | ModuleType of ModuleType.U.expr + | Functor of functor' type t = { parent : Odoc_model.Paths.Identifier.Signature.t; diff --git a/src/xref2/lang_of.ml b/src/xref2/lang_of.ml index 5c49cb96c9..88fff40ea4 100644 --- a/src/xref2/lang_of.ml +++ b/src/xref2/lang_of.ml @@ -651,6 +651,10 @@ and include_decl : (* Don't start shadowing within any signatures *) match d with | Alias p -> Alias (Path.module_ map p) + | Functor (Path p) -> Functor (Path (Path.module_ map p)) + | Functor (ModuleType mty) -> + let include_parent = Identifier.fresh_include_parent identifier in + Functor (ModuleType (u_module_type_expr map include_parent mty)) | ModuleType mty -> let include_parent = Identifier.fresh_include_parent identifier in ModuleType (u_module_type_expr map include_parent mty) diff --git a/src/xref2/link.ml b/src/xref2/link.ml index bd332ee691..1b38fa8c0a 100644 --- a/src/xref2/link.ml +++ b/src/xref2/link.ml @@ -707,6 +707,9 @@ and include_decl : Env.t -> Id.Signature.t -> Include.decl -> Include.decl = match decl with | ModuleType expr when is_elidable_with_module_type_u expr -> ModuleType expr | ModuleType expr -> ModuleType (u_module_type_expr env id expr) + | Functor (Path p) -> Functor (Path (module_path env p)) + | Functor (ModuleType expr) -> + Functor (ModuleType (u_module_type_expr env id expr)) | Alias p -> Alias (module_path env p) and module_type : Env.t -> ModuleType.t -> ModuleType.t = @@ -898,7 +901,9 @@ and u_module_type_expr : | Path p -> Path (module_type_path env p) | With (subs, expr) as unresolved -> ( let cexpr = Component.Of_Lang.(u_module_type_expr (empty ()) expr) in - match Tools.signature_of_u_module_type_expr env cexpr with + match + Tools.signature_of_u_module_type_expr env cexpr ~allow_functor:false + with | Ok sg -> With (handle_fragments env id sg subs, u_module_type_expr env id expr) | Error e -> @@ -945,7 +950,9 @@ and module_type_expr : Path { p_path; p_expansion = do_expn p_expansion (Some p_path) } | With { w_substitutions; w_expansion; w_expr } as unresolved -> ( let cexpr = Component.Of_Lang.(u_module_type_expr (empty ()) w_expr) in - match Tools.signature_of_u_module_type_expr env cexpr with + match + Tools.signature_of_u_module_type_expr env cexpr ~allow_functor:false + with | Ok sg -> With { diff --git a/src/xref2/subst.ml b/src/xref2/subst.ml index 49bbf0205e..64a16662ec 100644 --- a/src/xref2/subst.ml +++ b/src/xref2/subst.ml @@ -759,6 +759,8 @@ and module_decl s t = and include_decl s t = match t with | Include.Alias p -> Include.Alias (module_path s p) + | Functor (Path p) -> Functor (Path (module_path s p)) + | Functor (ModuleType t) -> ModuleType (u_module_type_expr s t) | ModuleType t -> ModuleType (u_module_type_expr s t) and module_ s t = diff --git a/src/xref2/tools.ml b/src/xref2/tools.ml index a560ec01cc..ca8e641db9 100644 --- a/src/xref2/tools.ml +++ b/src/xref2/tools.ml @@ -1586,6 +1586,12 @@ and assert_not_functor : type err. | Signature sg -> Ok sg | _ -> assert false +and assert_functor : type err. expansion -> (Component.Signature.t, err) result + = function + | Functor (_, mty) -> ( + match mty with Signature s -> Ok s | _ -> assert false) + | _ -> assert false + and unresolve_subs subs = List.map (function @@ -1621,22 +1627,28 @@ and signature_of_module_type_of : and signature_of_u_module_type_expr : Env.t -> Component.ModuleType.U.expr -> + allow_functor:bool -> (Component.Signature.t, expansion_of_module_error) result = - fun env m -> + fun env m ~allow_functor -> match m with | Component.ModuleType.U.Path p -> ( match resolve_module_type env p with - | Ok (_, mt) -> expansion_of_module_type env mt >>= assert_not_functor + | Ok (_, mt) -> ( + expansion_of_module_type env mt + >>= + match allow_functor with + | true -> assert_functor + | false -> assert_not_functor) | Error e -> Error (`UnresolvedPath (`ModuleType (p, e)))) | Signature s -> Ok s | With (subs, s) -> - signature_of_u_module_type_expr env s >>= fun sg -> + signature_of_u_module_type_expr env s ~allow_functor >>= fun sg -> let subs = unresolve_subs subs in handle_signature_with_subs env sg subs | TypeOf (desc, original_path) -> signature_of_module_type_of env desc ~original_path >>= assert_not_functor | Strengthen (expr, path, _aliasable) -> - signature_of_u_module_type_expr env expr >>= fun sg -> + signature_of_u_module_type_expr env expr ~allow_functor >>= fun sg -> Ok (Strengthen.signature path sg) and expansion_of_simple_expansion : @@ -1667,7 +1679,8 @@ and expansion_of_module_type_expr : | Component.ModuleType.With { w_expansion = Some e; _ } -> Ok (expansion_of_simple_expansion e) | Component.ModuleType.With { w_substitutions; w_expr; _ } -> - signature_of_u_module_type_expr env w_expr >>= fun sg -> + signature_of_u_module_type_expr env w_expr ~allow_functor:false + >>= fun sg -> let subs = unresolve_subs w_substitutions in handle_signature_with_subs env sg subs >>= fun sg -> Ok (Signature sg) | Component.ModuleType.Functor (arg, expr) -> Ok (Functor (arg, expr)) @@ -1681,7 +1694,8 @@ and expansion_of_module_type_expr : in expansion_of_module_path env ~strengthen p | Component.ModuleType.Strengthen { s_expr; s_path; _ } -> - signature_of_u_module_type_expr env s_expr >>= fun sg -> + signature_of_u_module_type_expr env s_expr ~allow_functor:false + >>= fun sg -> let sg = Strengthen.signature s_path sg in Ok (Signature sg) @@ -1812,7 +1826,12 @@ and fragmap : expansion_of_module_path env ~strengthen:true p >>= assert_not_functor >>= fun sg -> fragmap env subst sg >>= fun sg -> Ok (ModuleType (Signature sg)) - | ModuleType mty' -> Ok (ModuleType (With ([ subst ], mty'))) + | Functor (Path p) -> + expansion_of_module_path env ~strengthen:true p >>= assert_functor + >>= fun sg -> + fragmap env subst sg >>= fun sg -> Ok (ModuleType (Signature sg)) + | Functor (ModuleType mty') | ModuleType mty' -> + Ok (ModuleType (With ([ subst ], mty'))) in let map_module m new_subst = let open Component.Module in diff --git a/src/xref2/tools.mli b/src/xref2/tools.mli index 81c1322c42..b381c1534e 100644 --- a/src/xref2/tools.mli +++ b/src/xref2/tools.mli @@ -201,6 +201,8 @@ val prefix_signature : val assert_not_functor : expansion -> (Component.Signature.t, 'err) result +val assert_functor : expansion -> (Component.Signature.t, 'err) result + val expansion_of_module_path : Env.t -> strengthen:bool -> @@ -240,6 +242,7 @@ val expansion_of_module_type_expr : val signature_of_u_module_type_expr : Env.t -> Component.ModuleType.U.expr -> + allow_functor:bool -> (Component.Signature.t, expansion_of_module_error) result (** The following functions are use for the resolution of {{!type:Odoc_model.Paths.Fragment.t}Fragments} Whilst resolving fragments it diff --git a/test/generators/cases/oxcaml.mli b/test/generators/cases/oxcaml.mli index 11db3f653a..0557c84fe3 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -280,3 +280,31 @@ module M3 : sig @@ contended end (** [contended] modality applied to all definitions in the module, except the ones which have already specified this axis. *) + +(** {1 Include functor on signatures} *) + +module No_include_functor : sig +(** Module without any [include functor] features, this is how things are done + in plain OCaml at the moment. *) + module Make (T : sig type t end) : sig type included end + module T : sig + type t + end + + include module type of T + include module type of Make(T) +end + +module Include_functor : sig +(** Module which defines a functor and includes it via [module type of] *) + module Make (T : sig type t end) : sig type included end + type t + include functor module type of Make +end + +module Include_functor_named_type : sig +(** This is a Module where the type is named and then included. *) + module type Make = (_ : sig type t end) -> sig type included end + type t + include functor Make +end diff --git a/test/generators/cases/oxcaml_impl.ml b/test/generators/cases/oxcaml_impl.ml index 351121dbe1..caffeb8a98 100644 --- a/test/generators/cases/oxcaml_impl.ml +++ b/test/generators/cases/oxcaml_impl.ml @@ -8,3 +8,24 @@ end module Including = struct include To_be_included end + +(** {1 Include functor on structures} *) + +module No_include_functor = struct +(** This module shows how to achieve the effect without [include functor], + with an intermediate module [T]. *) + module Make (T : sig type t end) = struct type included end + module T = struct + type t + end + + include T + include Make(T) +end + +module Include_functor = struct +(** This module demonstratest the [include functor] functionality *) + module Make (T : sig type t end) = struct type included end + type t + include functor Make +end diff --git a/test/generators/html/Oxcaml-Include_functor-Make-argument-1-T.html b/test/generators/html/Oxcaml-Include_functor-Make-argument-1-T.html new file mode 100644 index 0000000000..4d5cabd316 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor-Make-argument-1-T.html @@ -0,0 +1,29 @@ + + + T (Oxcaml.Include_functor.Make.T) + + + + + + + + +
+

Parameter Make.T

+
+
+
+
+ + type t +
+
+
+ + diff --git a/test/generators/html/Oxcaml-Include_functor-Make.html b/test/generators/html/Oxcaml-Include_functor-Make.html new file mode 100644 index 0000000000..1c5465d38c --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor-Make.html @@ -0,0 +1,53 @@ + + + Make (Oxcaml.Include_functor.Make) + + + + + + + + +
+

Module Include_functor.Make

+

Module which defines a functor and includes it via + module type of +

+
+
+ +
+
+

Parameters +

+
+
+ + module + T + + : sig ... + end + + +
+
+

Signature

+
+
+ + type included +
+
+
+ + diff --git a/test/generators/html/Oxcaml-Include_functor.html b/test/generators/html/Oxcaml-Include_functor.html new file mode 100644 index 0000000000..85ae1d9012 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor.html @@ -0,0 +1,64 @@ + + + Include_functor (Oxcaml.Include_functor) + + + + + + + + +
+

Module Oxcaml.Include_functor

+
+
+
+
+ + + module + Make + + (T + : sig ... + end) : sig + ... end + + +
+
+

Module which defines a functor and includes it via + module type of +

+
+
+
+
+ + type t +
+
+
+
+ + + include functor + Make + + + +
+
+ + type included +
+
+
+
+
+ + diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html new file mode 100644 index 0000000000..e9fff279f8 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html @@ -0,0 +1,33 @@ + + + _ (Oxcaml.Include_functor_named_type.Make._) + + + + + + + + +
+

Parameter Make._

+
+
+
+
+ + type t +
+
+
+ + diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make.html b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make.html new file mode 100644 index 0000000000..4e0c82a4b9 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make.html @@ -0,0 +1,58 @@ + + + Make (Oxcaml.Include_functor_named_type.Make) + + + + + + + + +
+

Module type Include_functor_named_type.Make +

This is a Module where the type is named and then included.

+
+
+ +
+
+

Parameters +

+
+
+ + module + + _ + + + : sig ... + end + + +
+
+

Signature

+
+
+ + type included +
+
+
+ + diff --git a/test/generators/html/Oxcaml-Include_functor_named_type.html b/test/generators/html/Oxcaml-Include_functor_named_type.html new file mode 100644 index 0000000000..5cb1f9af18 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_named_type.html @@ -0,0 +1,74 @@ + + + + Include_functor_named_type (Oxcaml.Include_functor_named_type) + + + + + + + + +
+

Module Oxcaml.Include_functor_named_type +

+
+
+
+
+ + + module + type + Make + + + = functor + ( + _ + : sig ... + end) + -> + sig ... + end + + +
+
+

This is a Module where the type is named and then included.

+
+
+
+
+ + type t +
+
+
+
+ + + include functor + + Make + + + + +
+
+ + type included +
+
+
+
+
+ + diff --git a/test/generators/html/Oxcaml-No_include_functor-Make-argument-1-T.html b/test/generators/html/Oxcaml-No_include_functor-Make-argument-1-T.html new file mode 100644 index 0000000000..e0f179c914 --- /dev/null +++ b/test/generators/html/Oxcaml-No_include_functor-Make-argument-1-T.html @@ -0,0 +1,29 @@ + + + T (Oxcaml.No_include_functor.Make.T) + + + + + + + + +
+

Parameter Make.T

+
+
+
+
+ + type t +
+
+
+ + diff --git a/test/generators/html/Oxcaml-No_include_functor-Make.html b/test/generators/html/Oxcaml-No_include_functor-Make.html new file mode 100644 index 0000000000..d8e38c5788 --- /dev/null +++ b/test/generators/html/Oxcaml-No_include_functor-Make.html @@ -0,0 +1,54 @@ + + + Make (Oxcaml.No_include_functor.Make) + + + + + + + + +
+

Module No_include_functor.Make

+

Module without any include functor features, this + is how things are done in plain OCaml at the moment. +

+
+
+ +
+
+

Parameters +

+
+
+ + module + T + + : sig ... + end + + +
+
+

Signature

+
+
+ + type included +
+
+
+ + diff --git a/test/generators/html/Oxcaml-No_include_functor-T.html b/test/generators/html/Oxcaml-No_include_functor-T.html new file mode 100644 index 0000000000..f7336627ac --- /dev/null +++ b/test/generators/html/Oxcaml-No_include_functor-T.html @@ -0,0 +1,29 @@ + + + T (Oxcaml.No_include_functor.T) + + + + + + + + +
+

Module No_include_functor.T

+
+
+
+
+ + type t +
+
+
+ + diff --git a/test/generators/html/Oxcaml-No_include_functor.html b/test/generators/html/Oxcaml-No_include_functor.html new file mode 100644 index 0000000000..48419ca689 --- /dev/null +++ b/test/generators/html/Oxcaml-No_include_functor.html @@ -0,0 +1,97 @@ + + + No_include_functor (Oxcaml.No_include_functor) + + + + + + + + +
+

Module Oxcaml.No_include_functor

+
+
+
+
+ + + module + Make + + ( + T + : sig ... + end) : sig + ... end + + +
+
+

Module without any include functor features, this + is how things are done in plain OCaml at the moment. +

+
+
+
+
+ + + module + T + + : sig ... + end + + +
+
+
+
+ + + include + module type + of + T + + + +
+
+ + type t +
+
+
+
+
+
+ + + include + sig ... end + + + +
+
+ + type included + = + + Make(T).included + + + +
+
+
+
+
+ + diff --git a/test/generators/html/Oxcaml.html b/test/generators/html/Oxcaml.html index 88dfb52689..0a0cd9d6fb 100644 --- a/test/generators/html/Oxcaml.html +++ b/test/generators/html/Oxcaml.html @@ -72,6 +72,10 @@

Module Oxcaml

+
  • + Include functor on signatures + +
  • @@ -1182,6 +1186,51 @@

    +

    + Include + functor on signatures +

    +
    +
    + + + module + No_include_functor + + : sig ... + end + + +
    +
    +
    +
    + + + module + Include_functor + + : sig ... + end + + +
    +
    +
    +
    + + + module + + Include_functor_named_type + + + : sig ... + end + + +
    +
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor-Make-argument-1-T.html b/test/generators/html/Oxcaml_impl-Include_functor-Make-argument-1-T.html new file mode 100644 index 0000000000..89b5389e1f --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor-Make-argument-1-T.html @@ -0,0 +1,31 @@ + + + T (Oxcaml_impl.Include_functor.Make.T) + + + + + + + + +
    +

    Parameter Make.T

    +
    +
    +
    +
    + + type t +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Include_functor-Make.html b/test/generators/html/Oxcaml_impl-Include_functor-Make.html new file mode 100644 index 0000000000..a457eade36 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor-Make.html @@ -0,0 +1,55 @@ + + + Make (Oxcaml_impl.Include_functor.Make) + + + + + + + + +
    +

    Module Include_functor.Make

    +

    This module demonstratest the include functor + functionality +

    +
    +
    + +
    +
    +

    Parameters +

    +
    +
    + + module + + T + + : sig ... + end + + +
    +
    +

    Signature

    +
    +
    + + type included +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Include_functor.html b/test/generators/html/Oxcaml_impl-Include_functor.html new file mode 100644 index 0000000000..0ad6f118b5 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor.html @@ -0,0 +1,65 @@ + + + Include_functor (Oxcaml_impl.Include_functor) + + + + + + + + +
    +

    Module Oxcaml_impl.Include_functor

    +
    +
    +
    +
    + + + module + Make + + ( + T + : sig ... + end) : sig + ... end + + +
    +
    +

    This module demonstratest the include functor + functionality +

    +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + + include functor + Make + + + +
    +
    + + type included +
    +
    +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-No_include_functor-Make-argument-1-T.html b/test/generators/html/Oxcaml_impl-No_include_functor-Make-argument-1-T.html new file mode 100644 index 0000000000..cc2e3dc5a6 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-No_include_functor-Make-argument-1-T.html @@ -0,0 +1,31 @@ + + + T (Oxcaml_impl.No_include_functor.Make.T) + + + + + + + + +
    +

    Parameter Make.T

    +
    +
    +
    +
    + + type t +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-No_include_functor-Make.html b/test/generators/html/Oxcaml_impl-No_include_functor-Make.html new file mode 100644 index 0000000000..69ea651872 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-No_include_functor-Make.html @@ -0,0 +1,56 @@ + + + Make (Oxcaml_impl.No_include_functor.Make) + + + + + + + + +
    +

    Module No_include_functor.Make

    +

    This module shows how to achieve the effect without + include functor, with an intermediate module T + . +

    +
    +
    + +
    +
    +

    Parameters +

    +
    +
    + + module + + T + + : sig ... + end + + +
    +
    +

    Signature

    +
    +
    + + type included +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-No_include_functor-T.html b/test/generators/html/Oxcaml_impl-No_include_functor-T.html new file mode 100644 index 0000000000..78f282a825 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-No_include_functor-T.html @@ -0,0 +1,29 @@ + + + T (Oxcaml_impl.No_include_functor.T) + + + + + + + + +
    +

    Module No_include_functor.T

    +
    +
    +
    +
    + + type t +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-No_include_functor.html b/test/generators/html/Oxcaml_impl-No_include_functor.html new file mode 100644 index 0000000000..83fa229532 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-No_include_functor.html @@ -0,0 +1,104 @@ + + + No_include_functor (Oxcaml_impl.No_include_functor) + + + + + + + + +
    +

    Module Oxcaml_impl.No_include_functor

    +
    +
    +
    +
    + + + module + Make + + ( + T + : sig ... + end) : sig + ... end + + +
    +
    +

    This module shows how to achieve the effect without + include functor, with an intermediate module + T. +

    +
    +
    +
    +
    + + + module + T + + : sig ... + end + + +
    +
    +
    +
    + + + include + module type + of struct + include + T + end + + + +
    +
    + + type t + = + T.t + + +
    +
    +
    +
    +
    +
    + + + include + sig ... end + + + +
    +
    + + type included + = + + Make(T).included + + + +
    +
    +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl.html b/test/generators/html/Oxcaml_impl.html index 285dc626a8..ad934c42c6 100644 --- a/test/generators/html/Oxcaml_impl.html +++ b/test/generators/html/Oxcaml_impl.html @@ -14,6 +14,16 @@

    Module Oxcaml_impl

    +
    + +
    @@ -54,6 +64,36 @@

    Module Oxcaml_impl

    +

    + Include + functor on structures +

    +
    +
    + + + module + No_include_functor + + : sig ... + end + + +
    +
    +
    +
    + + + module + Include_functor + + : sig ... + end + + +
    +
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index 77bc5f1da0..37a8e467cf 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -3,3 +3,13 @@ Oxcaml-module-type-S.html Oxcaml-M1.html Oxcaml-M2.html Oxcaml-M3.html +Oxcaml-No_include_functor.html +Oxcaml-No_include_functor-Make.html +Oxcaml-No_include_functor-Make-argument-1-T.html +Oxcaml-No_include_functor-T.html +Oxcaml-Include_functor.html +Oxcaml-Include_functor-Make.html +Oxcaml-Include_functor-Make-argument-1-T.html +Oxcaml-Include_functor_named_type.html +Oxcaml-Include_functor_named_type-module-type-Make.html +Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html diff --git a/test/generators/html/oxcaml_impl.targets b/test/generators/html/oxcaml_impl.targets index 0b5d029cba..72c2b4911e 100644 --- a/test/generators/html/oxcaml_impl.targets +++ b/test/generators/html/oxcaml_impl.targets @@ -1,3 +1,10 @@ Oxcaml_impl.html Oxcaml_impl-To_be_included.html Oxcaml_impl-Including.html +Oxcaml_impl-No_include_functor.html +Oxcaml_impl-No_include_functor-Make.html +Oxcaml_impl-No_include_functor-Make-argument-1-T.html +Oxcaml_impl-No_include_functor-T.html +Oxcaml_impl-Include_functor.html +Oxcaml_impl-Include_functor-Make.html +Oxcaml_impl-Include_functor-Make-argument-1-T.html diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 86830b7210..3a47f2cd64 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -240,5 +240,34 @@ \subsubsection{Modalities on module declarations\label{Oxcaml--modalities-on-mod \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}\ocamlinlinecode{contended} modality applied to all definitions in the module, except the ones which have already specified this axis.\end{ocamlindent}% \medbreak +\subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signatures}}% +\label{Oxcaml--module-No_include_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-No_include_functor]{\ocamlinlinecode{No\_\allowbreak{}include\_\allowbreak{}functor}}}\label{Oxcaml-No_include_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-No_include_functor--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-No_include_functor-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-No_include_functor-Make-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\begin{ocamlindent}Module without any \ocamlinlinecode{include functor} features, this is how things are done in plain OCaml at the moment.\end{ocamlindent}% +\medbreak +\label{Oxcaml-No_include_functor--module-T}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-No_include_functor-T]{\ocamlinlinecode{T}}}\label{Oxcaml-No_include_functor-T}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-No_include_functor-T--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\ocamltag{keyword}{include} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-No_include_functor-T]{\ocamlinlinecode{T}}\label{Oxcaml-No_include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-No_include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-No_include_functor-Make--type-included]{\ocamlinlinecode{Make(T).\allowbreak{}included}}}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml--module-Include_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor]{\ocamlinlinecode{Include\_\allowbreak{}functor}}}\label{Oxcaml-Include_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor-Make-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\begin{ocamlindent}Module which defines a functor and includes it via \ocamlinlinecode{module type of}\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml--module-Include_functor_named_type}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type}}}\label{Oxcaml-Include_functor_named_type}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_named_type-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-Make--parameters_3}}% +\label{Oxcaml-Include_functor_named_type-module-type-Make--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\subsubsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-Make--signature_3}}% +\label{Oxcaml-Include_functor_named_type-module-type-Make--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a Module where the type is named and then included.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_named_type--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_named_type-module-type-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ \input{Oxcaml.M1.tex} diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index 149a39e20c..36e9e66238 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -6,5 +6,21 @@ \section{Module \ocamlinlinecode{Oxcaml\_\allowbreak{}impl}}\label{Oxcaml_impl}% \label{Oxcaml_impl--module-Including}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Including]{\ocamlinlinecode{Including}}}\label{Oxcaml_impl-Including}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[Oxcaml_impl-To_be_included]{\ocamlinlinecode{To\_\allowbreak{}be\_\allowbreak{}included}} \ocamltag{keyword}{end}\label{Oxcaml_impl-Including--val-add}\ocamlcodefragment{\ocamltag{keyword}{val} add : bool \ocamltag{arrow}{$\rightarrow$} int \ocamltag{arrow}{$\rightarrow$} int \ocamltag{arrow}{$\rightarrow$} int [@@zero\_\allowbreak{}alloc]}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on-structures}}% +\label{Oxcaml_impl--module-No_include_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-No_include_functor]{\ocamlinlinecode{No\_\allowbreak{}include\_\allowbreak{}functor}}}\label{Oxcaml_impl-No_include_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-No_include_functor--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-No_include_functor-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-No_include_functor-Make-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\begin{ocamlindent}This module shows how to achieve the effect without \ocamlinlinecode{include functor}, with an intermediate module \ocamlinlinecode{T}.\end{ocamlindent}% +\medbreak +\label{Oxcaml_impl-No_include_functor--module-T}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-No_include_functor-T]{\ocamlinlinecode{T}}}\label{Oxcaml_impl-No_include_functor-T}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-No_include_functor-T--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\ocamltag{keyword}{include} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[Oxcaml_impl-No_include_functor-T]{\ocamlinlinecode{T}} \ocamltag{keyword}{end}\label{Oxcaml_impl-No_include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = \hyperref[Oxcaml_impl-No_include_functor-T--type-t]{\ocamlinlinecode{T.\allowbreak{}t}}}\\ +\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml_impl-No_include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-No_include_functor-Make--type-included]{\ocamlinlinecode{Make(T).\allowbreak{}included}}}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml_impl--module-Include_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor]{\ocamlinlinecode{Include\_\allowbreak{}functor}}}\label{Oxcaml_impl-Include_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Include_functor--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Include_functor-Make-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\begin{ocamlindent}This module demonstratest the \ocamlinlinecode{include functor} functionality\end{ocamlindent}% +\medbreak +\label{Oxcaml_impl-Include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Include_functor-Make]{\ocamlinlinecode{Make}}\label{Oxcaml_impl-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index 5efe5a1677..34be12a35e 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11951,7 +11951,17 @@ Oxcaml-module-type-S.html.gen Oxcaml-M1.html.gen Oxcaml-M2.html.gen - Oxcaml-M3.html.gen) + Oxcaml-M3.html.gen + Oxcaml-No_include_functor.html.gen + Oxcaml-No_include_functor-Make.html.gen + Oxcaml-No_include_functor-Make-argument-1-T.html.gen + Oxcaml-No_include_functor-T.html.gen + Oxcaml-Include_functor.html.gen + Oxcaml-Include_functor-Make.html.gen + Oxcaml-Include_functor-Make-argument-1-T.html.gen + Oxcaml-Include_functor_named_type.html.gen + Oxcaml-Include_functor_named_type-module-type-Make.html.gen + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html.gen) (package odoc) (action (run @@ -11994,6 +12004,82 @@ (package odoc) (action (diff Oxcaml-M3.html Oxcaml-M3.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml-No_include_functor.html Oxcaml-No_include_functor.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-No_include_functor-Make.html + Oxcaml-No_include_functor-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-No_include_functor-Make-argument-1-T.html + Oxcaml-No_include_functor-Make-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-No_include_functor-T.html + Oxcaml-No_include_functor-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml-Include_functor.html Oxcaml-Include_functor.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor-Make.html + Oxcaml-Include_functor-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor-Make-argument-1-T.html + Oxcaml-Include_functor-Make-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_named_type.html + Oxcaml-Include_functor_named_type.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_named_type-module-type-Make.html + Oxcaml-Include_functor_named_type-module-type-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12054,7 +12140,17 @@ (subdir man (rule - (targets Oxcaml.3o.gen Oxcaml.M1.3o.gen Oxcaml.M2.3o.gen Oxcaml.M3.3o.gen) + (targets + Oxcaml.3o.gen + Oxcaml.M1.3o.gen + Oxcaml.M2.3o.gen + Oxcaml.M3.3o.gen + Oxcaml.No_include_functor.3o.gen + Oxcaml.No_include_functor.Make.3o.gen + Oxcaml.No_include_functor.T.3o.gen + Oxcaml.Include_functor.3o.gen + Oxcaml.Include_functor.Make.3o.gen + Oxcaml.Include_functor_named_type.3o.gen) (package odoc) (action (run odoc man-generate -o . --extra-suffix gen %{dep:../oxcaml.odocl})) @@ -12082,6 +12178,46 @@ (package odoc) (action (diff Oxcaml.M3.3o Oxcaml.M3.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml.No_include_functor.3o Oxcaml.No_include_functor.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.No_include_functor.Make.3o + Oxcaml.No_include_functor.Make.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml.No_include_functor.T.3o Oxcaml.No_include_functor.T.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml.Include_functor.3o Oxcaml.Include_functor.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml.Include_functor.Make.3o Oxcaml.Include_functor.Make.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_named_type.3o + Oxcaml.Include_functor_named_type.3o.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12109,7 +12245,17 @@ Oxcaml-module-type-S.md.gen Oxcaml-M1.md.gen Oxcaml-M2.md.gen - Oxcaml-M3.md.gen) + Oxcaml-M3.md.gen + Oxcaml-No_include_functor.md.gen + Oxcaml-No_include_functor-Make.md.gen + Oxcaml-No_include_functor-Make-argument-1-T.md.gen + Oxcaml-No_include_functor-T.md.gen + Oxcaml-Include_functor.md.gen + Oxcaml-Include_functor-Make.md.gen + Oxcaml-Include_functor-Make-argument-1-T.md.gen + Oxcaml-Include_functor_named_type.md.gen + Oxcaml-Include_functor_named_type-module-type-Make.md.gen + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md.gen) (package odoc) (action (run @@ -12150,6 +12296,78 @@ (package odoc) (action (diff Oxcaml-M3.md Oxcaml-M3.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml-No_include_functor.md Oxcaml-No_include_functor.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-No_include_functor-Make.md + Oxcaml-No_include_functor-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-No_include_functor-Make-argument-1-T.md + Oxcaml-No_include_functor-Make-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml-No_include_functor-T.md Oxcaml-No_include_functor-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml-Include_functor.md Oxcaml-Include_functor.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml-Include_functor-Make.md Oxcaml-Include_functor-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor-Make-argument-1-T.md + Oxcaml-Include_functor-Make-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_named_type.md + Oxcaml-Include_functor_named_type.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_named_type-module-type-Make.md + Oxcaml-Include_functor_named_type-module-type-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12175,7 +12393,14 @@ (targets Oxcaml_impl.html.gen Oxcaml_impl-To_be_included.html.gen - Oxcaml_impl-Including.html.gen) + Oxcaml_impl-Including.html.gen + Oxcaml_impl-No_include_functor.html.gen + Oxcaml_impl-No_include_functor-Make.html.gen + Oxcaml_impl-No_include_functor-Make-argument-1-T.html.gen + Oxcaml_impl-No_include_functor-T.html.gen + Oxcaml_impl-Include_functor.html.gen + Oxcaml_impl-Include_functor-Make.html.gen + Oxcaml_impl-Include_functor-Make-argument-1-T.html.gen) (package odoc) (action (run @@ -12206,6 +12431,62 @@ (package odoc) (action (diff Oxcaml_impl-Including.html Oxcaml_impl-Including.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor.html + Oxcaml_impl-No_include_functor.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor-Make.html + Oxcaml_impl-No_include_functor-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor-Make-argument-1-T.html + Oxcaml_impl-No_include_functor-Make-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor-T.html + Oxcaml_impl-No_include_functor-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor.html + Oxcaml_impl-Include_functor.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor-Make.html + Oxcaml_impl-Include_functor-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor-Make-argument-1-T.html + Oxcaml_impl-Include_functor-Make-argument-1-T.html.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12270,7 +12551,12 @@ (targets Oxcaml_impl.3o.gen Oxcaml_impl.To_be_included.3o.gen - Oxcaml_impl.Including.3o.gen) + Oxcaml_impl.Including.3o.gen + Oxcaml_impl.No_include_functor.3o.gen + Oxcaml_impl.No_include_functor.Make.3o.gen + Oxcaml_impl.No_include_functor.T.3o.gen + Oxcaml_impl.Include_functor.3o.gen + Oxcaml_impl.Include_functor.Make.3o.gen) (package odoc) (action (run @@ -12299,6 +12585,44 @@ (package odoc) (action (diff Oxcaml_impl.Including.3o Oxcaml_impl.Including.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.No_include_functor.3o + Oxcaml_impl.No_include_functor.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.No_include_functor.Make.3o + Oxcaml_impl.No_include_functor.Make.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.No_include_functor.T.3o + Oxcaml_impl.No_include_functor.T.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml_impl.Include_functor.3o Oxcaml_impl.Include_functor.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.Include_functor.Make.3o + Oxcaml_impl.Include_functor.Make.3o.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12324,7 +12648,14 @@ (targets Oxcaml_impl.md.gen Oxcaml_impl-To_be_included.md.gen - Oxcaml_impl-Including.md.gen) + Oxcaml_impl-Including.md.gen + Oxcaml_impl-No_include_functor.md.gen + Oxcaml_impl-No_include_functor-Make.md.gen + Oxcaml_impl-No_include_functor-Make-argument-1-T.md.gen + Oxcaml_impl-No_include_functor-T.md.gen + Oxcaml_impl-Include_functor.md.gen + Oxcaml_impl-Include_functor-Make.md.gen + Oxcaml_impl-Include_functor-Make-argument-1-T.md.gen) (package odoc) (action (run @@ -12353,6 +12684,60 @@ (package odoc) (action (diff Oxcaml_impl-Including.md Oxcaml_impl-Including.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor.md + Oxcaml_impl-No_include_functor.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor-Make.md + Oxcaml_impl-No_include_functor-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor-Make-argument-1-T.md + Oxcaml_impl-No_include_functor-Make-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-No_include_functor-T.md + Oxcaml_impl-No_include_functor-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff Oxcaml_impl-Include_functor.md Oxcaml_impl-Include_functor.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor-Make.md + Oxcaml_impl-Include_functor-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor-Make-argument-1-T.md + Oxcaml_impl-Include_functor-Make-argument-1-T.md.gen)) (enabled_if %{ocaml-config:ox}))) (subdir diff --git a/test/generators/man/Oxcaml.3o b/test/generators/man/Oxcaml.3o index ada6bbb18b..a20223f479 100644 --- a/test/generators/man/Oxcaml.3o +++ b/test/generators/man/Oxcaml.3o @@ -681,4 +681,13 @@ Module with portable modality\. The modality is applied to all value members of .ti +2 contended modality applied to all definitions in the module, except the ones which have already specified this axis\. .nf - +.sp +.in 3 +\fB15 Include functor on signatures\fR +.in +.sp +\f[CB]module\fR No_include_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Include_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Include_functor_named_type : \f[CB]sig\fR \.\.\. \f[CB]end\fR diff --git a/test/generators/man/Oxcaml.Include_functor.3o b/test/generators/man/Oxcaml.Include_functor.3o new file mode 100644 index 0000000000..a0776f720c --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor.3o @@ -0,0 +1,23 @@ + +.TH Include_functor 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml\.Include_functor\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR Make (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.fi +.br +.ti +2 +Module which defines a functor and includes it via module type of +.nf +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.Include_functor.Make.3o b/test/generators/man/Oxcaml.Include_functor.Make.3o new file mode 100644 index 0000000000..a5217b11b7 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor.Make.3o @@ -0,0 +1,33 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor\.Make +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor\.Make\fR +.in +.sp +.fi +Module which defines a functor and includes it via module type of +.nf +.SH Documentation +.sp +.nf +.sp +.in 3 +\fB1 Parameters\fR +.in +.sp +\f[CB]module\fR T : \f[CB]sig\fR +.br +.ti +2 +\f[CB]type\fR t +.br +\f[CB]end\fR +.sp +.in 3 +\fB2 Signature\fR +.in +.sp +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.Include_functor_named_type.3o b/test/generators/man/Oxcaml.Include_functor_named_type.3o new file mode 100644 index 0000000000..f8ef1c2b17 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_named_type.3o @@ -0,0 +1,45 @@ + +.TH Include_functor_named_type 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_named_type +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml\.Include_functor_named_type\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR \f[CB]type\fR Make = \f[CB]sig\fR +.br +.ti +2 +.sp +.ti +2 +\fB1\.1 Parameters\fR +.sp +.ti +2 +\f[CB]module\fR _ : \f[CB]sig\fR +.br +.ti +4 +\f[CB]type\fR t +.br +.ti +2 +\f[CB]end\fR +.sp +.ti +2 +\fB1\.2 Signature\fR +.sp +.ti +2 +\f[CB]type\fR included +.br +\f[CB]end\fR +.fi +.br +.ti +2 +This is a Module where the type is named and then included\. +.nf +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.No_include_functor.3o b/test/generators/man/Oxcaml.No_include_functor.3o new file mode 100644 index 0000000000..d9b130cc57 --- /dev/null +++ b/test/generators/man/Oxcaml.No_include_functor.3o @@ -0,0 +1,25 @@ + +.TH No_include_functor 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.No_include_functor +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml\.No_include_functor\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR Make (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.fi +.br +.ti +2 +Module without any include functor features, this is how things are done in plain OCaml at the moment\. +.nf +.sp +\f[CB]module\fR T : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR included = Make(T)\.included diff --git a/test/generators/man/Oxcaml.No_include_functor.Make.3o b/test/generators/man/Oxcaml.No_include_functor.Make.3o new file mode 100644 index 0000000000..6438bce203 --- /dev/null +++ b/test/generators/man/Oxcaml.No_include_functor.Make.3o @@ -0,0 +1,33 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.No_include_functor\.Make +.SH Synopsis +.sp +.in 2 +\fBModule No_include_functor\.Make\fR +.in +.sp +.fi +Module without any include functor features, this is how things are done in plain OCaml at the moment\. +.nf +.SH Documentation +.sp +.nf +.sp +.in 3 +\fB1 Parameters\fR +.in +.sp +\f[CB]module\fR T : \f[CB]sig\fR +.br +.ti +2 +\f[CB]type\fR t +.br +\f[CB]end\fR +.sp +.in 3 +\fB2 Signature\fR +.in +.sp +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.No_include_functor.T.3o b/test/generators/man/Oxcaml.No_include_functor.T.3o new file mode 100644 index 0000000000..62acf3eb80 --- /dev/null +++ b/test/generators/man/Oxcaml.No_include_functor.T.3o @@ -0,0 +1,14 @@ + +.TH T 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.No_include_functor\.T +.SH Synopsis +.sp +.in 2 +\fBModule No_include_functor\.T\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]type\fR t diff --git a/test/generators/man/Oxcaml_impl.3o b/test/generators/man/Oxcaml_impl.3o index c73fcd111f..ee701dd1db 100644 --- a/test/generators/man/Oxcaml_impl.3o +++ b/test/generators/man/Oxcaml_impl.3o @@ -16,3 +16,11 @@ Oxcaml_impl \f[CB]module\fR To_be_included : \f[CB]sig\fR \.\.\. \f[CB]end\fR .sp \f[CB]module\fR Including : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +.in 3 +\fB1 Include functor on structures\fR +.in +.sp +\f[CB]module\fR No_include_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Include_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR diff --git a/test/generators/man/Oxcaml_impl.Include_functor.3o b/test/generators/man/Oxcaml_impl.Include_functor.3o new file mode 100644 index 0000000000..ccdb31fa51 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Include_functor.3o @@ -0,0 +1,23 @@ + +.TH Include_functor 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Include_functor +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml_impl\.Include_functor\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR Make (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.fi +.br +.ti +2 +This module demonstratest the include functor functionality +.nf +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml_impl.Include_functor.Make.3o b/test/generators/man/Oxcaml_impl.Include_functor.Make.3o new file mode 100644 index 0000000000..de73e9d81e --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Include_functor.Make.3o @@ -0,0 +1,33 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Include_functor\.Make +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor\.Make\fR +.in +.sp +.fi +This module demonstratest the include functor functionality +.nf +.SH Documentation +.sp +.nf +.sp +.in 3 +\fB1 Parameters\fR +.in +.sp +\f[CB]module\fR T : \f[CB]sig\fR +.br +.ti +2 +\f[CB]type\fR t +.br +\f[CB]end\fR +.sp +.in 3 +\fB2 Signature\fR +.in +.sp +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml_impl.No_include_functor.3o b/test/generators/man/Oxcaml_impl.No_include_functor.3o new file mode 100644 index 0000000000..0c1058d355 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.No_include_functor.3o @@ -0,0 +1,25 @@ + +.TH No_include_functor 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.No_include_functor +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml_impl\.No_include_functor\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR Make (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.fi +.br +.ti +2 +This module shows how to achieve the effect without include functor, with an intermediate module T\. +.nf +.sp +\f[CB]module\fR T : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]type\fR t = T\.t +.sp +\f[CB]type\fR included = Make(T)\.included diff --git a/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o b/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o new file mode 100644 index 0000000000..283ddc0e27 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o @@ -0,0 +1,33 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.No_include_functor\.Make +.SH Synopsis +.sp +.in 2 +\fBModule No_include_functor\.Make\fR +.in +.sp +.fi +This module shows how to achieve the effect without include functor, with an intermediate module T\. +.nf +.SH Documentation +.sp +.nf +.sp +.in 3 +\fB1 Parameters\fR +.in +.sp +\f[CB]module\fR T : \f[CB]sig\fR +.br +.ti +2 +\f[CB]type\fR t +.br +\f[CB]end\fR +.sp +.in 3 +\fB2 Signature\fR +.in +.sp +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml_impl.No_include_functor.T.3o b/test/generators/man/Oxcaml_impl.No_include_functor.T.3o new file mode 100644 index 0000000000..96dd994d78 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.No_include_functor.T.3o @@ -0,0 +1,14 @@ + +.TH T 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.No_include_functor\.T +.SH Synopsis +.sp +.in 2 +\fBModule No_include_functor\.T\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]type\fR t diff --git a/test/generators/man/oxcaml.targets b/test/generators/man/oxcaml.targets index 3d3984495e..e45f9b79eb 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -2,3 +2,9 @@ Oxcaml.3o Oxcaml.M1.3o Oxcaml.M2.3o Oxcaml.M3.3o +Oxcaml.No_include_functor.3o +Oxcaml.No_include_functor.Make.3o +Oxcaml.No_include_functor.T.3o +Oxcaml.Include_functor.3o +Oxcaml.Include_functor.Make.3o +Oxcaml.Include_functor_named_type.3o diff --git a/test/generators/man/oxcaml_impl.targets b/test/generators/man/oxcaml_impl.targets index d0f3634ab4..e012c68915 100644 --- a/test/generators/man/oxcaml_impl.targets +++ b/test/generators/man/oxcaml_impl.targets @@ -1,3 +1,8 @@ Oxcaml_impl.3o Oxcaml_impl.To_be_included.3o Oxcaml_impl.Including.3o +Oxcaml_impl.No_include_functor.3o +Oxcaml_impl.No_include_functor.Make.3o +Oxcaml_impl.No_include_functor.T.3o +Oxcaml_impl.Include_functor.3o +Oxcaml_impl.Include_functor.Make.3o diff --git a/test/generators/markdown/Oxcaml-Include_functor-Make-argument-1-T.md b/test/generators/markdown/Oxcaml-Include_functor-Make-argument-1-T.md new file mode 100644 index 0000000000..9459dc695c --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor-Make-argument-1-T.md @@ -0,0 +1,6 @@ + +# Parameter `Make.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor-Make.md b/test/generators/markdown/Oxcaml-Include_functor-Make.md new file mode 100644 index 0000000000..a131081dc7 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor-Make.md @@ -0,0 +1,17 @@ + +# Module `Include_functor.Make` + +Module which defines a functor and includes it via `module type of` + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor.md b/test/generators/markdown/Oxcaml-Include_functor.md new file mode 100644 index 0000000000..e54338a324 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor.md @@ -0,0 +1,14 @@ + +# Module `Oxcaml.Include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +Module which defines a functor and includes it via `module type of` + +```ocaml +type t +``` +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md new file mode 100644 index 0000000000..4f3631ee75 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md @@ -0,0 +1,6 @@ + +# Parameter `Make._` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make.md new file mode 100644 index 0000000000..2538468067 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make.md @@ -0,0 +1,17 @@ + +# Module type `Include_functor_named_type.Make` + +This is a Module where the type is named and then included. + + +## Parameters + +```ocaml +module _ : sig ... end +``` + +## Signature + +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type.md b/test/generators/markdown/Oxcaml-Include_functor_named_type.md new file mode 100644 index 0000000000..7aa04d1ac8 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type.md @@ -0,0 +1,14 @@ + +# Module `Oxcaml.Include_functor_named_type` + +```ocaml +module type Make = functor (_ : sig ... end) -> sig ... end +``` +This is a Module where the type is named and then included. + +```ocaml +type t +``` +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-No_include_functor-Make-argument-1-T.md b/test/generators/markdown/Oxcaml-No_include_functor-Make-argument-1-T.md new file mode 100644 index 0000000000..9459dc695c --- /dev/null +++ b/test/generators/markdown/Oxcaml-No_include_functor-Make-argument-1-T.md @@ -0,0 +1,6 @@ + +# Parameter `Make.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-No_include_functor-Make.md b/test/generators/markdown/Oxcaml-No_include_functor-Make.md new file mode 100644 index 0000000000..f6909af03f --- /dev/null +++ b/test/generators/markdown/Oxcaml-No_include_functor-Make.md @@ -0,0 +1,17 @@ + +# Module `No_include_functor.Make` + +Module without any `include functor` features, this is how things are done in plain OCaml at the moment. + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-No_include_functor-T.md b/test/generators/markdown/Oxcaml-No_include_functor-T.md new file mode 100644 index 0000000000..af326e0804 --- /dev/null +++ b/test/generators/markdown/Oxcaml-No_include_functor-T.md @@ -0,0 +1,6 @@ + +# Module `No_include_functor.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-No_include_functor.md b/test/generators/markdown/Oxcaml-No_include_functor.md new file mode 100644 index 0000000000..c6228a22f0 --- /dev/null +++ b/test/generators/markdown/Oxcaml-No_include_functor.md @@ -0,0 +1,17 @@ + +# Module `Oxcaml.No_include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +Module without any `include functor` features, this is how things are done in plain OCaml at the moment. + +```ocaml +module T : sig ... end +``` +```ocaml +type t +``` +```ocaml +type included = Make(T).included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml.md b/test/generators/markdown/Oxcaml.md index 20ba08da3f..ef5b4fbcc7 100644 --- a/test/generators/markdown/Oxcaml.md +++ b/test/generators/markdown/Oxcaml.md @@ -345,3 +345,16 @@ Module with `portable` modality. The modality is applied to all value members of module M3 : sig ... end ``` `contended` modality applied to all definitions in the module, except the ones which have already specified this axis. + + +## Include functor on signatures + +```ocaml +module No_include_functor : sig ... end +``` +```ocaml +module Include_functor : sig ... end +``` +```ocaml +module Include_functor_named_type : sig ... end +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor-Make-argument-1-T.md b/test/generators/markdown/Oxcaml_impl-Include_functor-Make-argument-1-T.md new file mode 100644 index 0000000000..9459dc695c --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor-Make-argument-1-T.md @@ -0,0 +1,6 @@ + +# Parameter `Make.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md b/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md new file mode 100644 index 0000000000..6bb4b93f08 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md @@ -0,0 +1,17 @@ + +# Module `Include_functor.Make` + +This module demonstratest the `include functor` functionality + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor.md b/test/generators/markdown/Oxcaml_impl-Include_functor.md new file mode 100644 index 0000000000..0478033a7b --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor.md @@ -0,0 +1,14 @@ + +# Module `Oxcaml_impl.Include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +This module demonstratest the `include functor` functionality + +```ocaml +type t +``` +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-No_include_functor-Make-argument-1-T.md b/test/generators/markdown/Oxcaml_impl-No_include_functor-Make-argument-1-T.md new file mode 100644 index 0000000000..9459dc695c --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor-Make-argument-1-T.md @@ -0,0 +1,6 @@ + +# Parameter `Make.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md b/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md new file mode 100644 index 0000000000..81cbc7cb82 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md @@ -0,0 +1,17 @@ + +# Module `No_include_functor.Make` + +This module shows how to achieve the effect without `include functor`, with an intermediate module `T`. + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-No_include_functor-T.md b/test/generators/markdown/Oxcaml_impl-No_include_functor-T.md new file mode 100644 index 0000000000..af326e0804 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor-T.md @@ -0,0 +1,6 @@ + +# Module `No_include_functor.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-No_include_functor.md b/test/generators/markdown/Oxcaml_impl-No_include_functor.md new file mode 100644 index 0000000000..10f6b8c8ab --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor.md @@ -0,0 +1,17 @@ + +# Module `Oxcaml_impl.No_include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +This module shows how to achieve the effect without `include functor`, with an intermediate module `T`. + +```ocaml +module T : sig ... end +``` +```ocaml +type t = T.t +``` +```ocaml +type included = Make(T).included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl.md b/test/generators/markdown/Oxcaml_impl.md index f903a30efd..26366c6320 100644 --- a/test/generators/markdown/Oxcaml_impl.md +++ b/test/generators/markdown/Oxcaml_impl.md @@ -9,4 +9,13 @@ module To_be_included : sig ... end ``` ```ocaml module Including : sig ... end +``` + +## Include functor on structures + +```ocaml +module No_include_functor : sig ... end +``` +```ocaml +module Include_functor : sig ... end ``` \ No newline at end of file diff --git a/test/generators/markdown/oxcaml.targets b/test/generators/markdown/oxcaml.targets index 03016b8b2f..4e6a13cce2 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -3,3 +3,13 @@ Oxcaml-module-type-S.md Oxcaml-M1.md Oxcaml-M2.md Oxcaml-M3.md +Oxcaml-No_include_functor.md +Oxcaml-No_include_functor-Make.md +Oxcaml-No_include_functor-Make-argument-1-T.md +Oxcaml-No_include_functor-T.md +Oxcaml-Include_functor.md +Oxcaml-Include_functor-Make.md +Oxcaml-Include_functor-Make-argument-1-T.md +Oxcaml-Include_functor_named_type.md +Oxcaml-Include_functor_named_type-module-type-Make.md +Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md diff --git a/test/generators/markdown/oxcaml_impl.targets b/test/generators/markdown/oxcaml_impl.targets index 1125335e87..9f7542eb16 100644 --- a/test/generators/markdown/oxcaml_impl.targets +++ b/test/generators/markdown/oxcaml_impl.targets @@ -1,3 +1,10 @@ Oxcaml_impl.md Oxcaml_impl-To_be_included.md Oxcaml_impl-Including.md +Oxcaml_impl-No_include_functor.md +Oxcaml_impl-No_include_functor-Make.md +Oxcaml_impl-No_include_functor-Make-argument-1-T.md +Oxcaml_impl-No_include_functor-T.md +Oxcaml_impl-Include_functor.md +Oxcaml_impl-Include_functor-Make.md +Oxcaml_impl-Include_functor-Make-argument-1-T.md