From e2b67843d076436f643c3b0eba480b809e62e312 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Wed, 10 Jun 2026 15:15:48 +0200 Subject: [PATCH 01/23] Initial code sample of `include functor` Signed-off-by: Marek Kubica --- test/generators/cases/oxcaml.mli | 6 ++ ...aml-Include_functor-Make-argument-1-T.html | 29 ++++++++ .../html/Oxcaml-Include_functor-Make.html | 50 ++++++++++++++ .../html/Oxcaml-Include_functor.html | 48 +++++++++++++ test/generators/html/Oxcaml.html | 13 ++++ test/generators/html/oxcaml.targets | 3 + test/generators/latex/Oxcaml.tex | 5 ++ test/generators/link.dune.inc | 68 ++++++++++++++++++- test/generators/man/Oxcaml.3o | 3 +- test/generators/man/Oxcaml.Include_functor.3o | 18 +++++ .../man/Oxcaml.Include_functor.Make.3o | 30 ++++++++ test/generators/man/oxcaml.targets | 2 + ...xcaml-Include_functor-Make-argument-1-T.md | 6 ++ .../markdown/Oxcaml-Include_functor-Make.md | 15 ++++ .../markdown/Oxcaml-Include_functor.md | 12 ++++ test/generators/markdown/Oxcaml.md | 3 + test/generators/markdown/oxcaml.targets | 3 + 17 files changed, 310 insertions(+), 4 deletions(-) create mode 100644 test/generators/html/Oxcaml-Include_functor-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Include_functor-Make.html create mode 100644 test/generators/html/Oxcaml-Include_functor.html create mode 100644 test/generators/man/Oxcaml.Include_functor.3o create mode 100644 test/generators/man/Oxcaml.Include_functor.Make.3o create mode 100644 test/generators/markdown/Oxcaml-Include_functor-Make-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor-Make.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor.md diff --git a/test/generators/cases/oxcaml.mli b/test/generators/cases/oxcaml.mli index 3947f4e83a..8c34d0e974 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -517,3 +517,9 @@ type mode_cstr = (** Nested arrow: higher-order with a mode on the inner argument. *) | Mc_gadt : ('a @ once -> 'a) -> mode_cstr (** GADT constructor *) + +module Include_functor : sig + module Make (T : sig type t end) : sig type included end + type t + include functor module type of 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..2cc91dce29 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor-Make.html @@ -0,0 +1,50 @@ + + + Make (Oxcaml.Include_functor.Make) + + + + + + + + +
+

Module Include_functor.Make

+
+
+ +
+
+

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..f964624cb1 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor.html @@ -0,0 +1,48 @@ + + + Include_functor (Oxcaml.Include_functor) + + + + + + + + +
+

Module Oxcaml.Include_functor

+
+
+
+
+ + + module + Make + + (T + : sig ... + end) : sig + ... end + + +
+
+
+
+ + type t +
+
+
+
+ + type included +
+
+
+ + diff --git a/test/generators/html/Oxcaml.html b/test/generators/html/Oxcaml.html index 91cd5aaf5e..a60193044a 100644 --- a/test/generators/html/Oxcaml.html +++ b/test/generators/html/Oxcaml.html @@ -2254,6 +2254,19 @@

+
+
+ + + module + Include_functor + + : sig ... + end + + +
+
diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index 5d69622d32..e650d68fe0 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -8,3 +8,6 @@ Oxcaml-module-type-S.html Oxcaml-M1.html Oxcaml-M2.html Oxcaml-M3.html +Oxcaml-Include_functor.html +Oxcaml-Include_functor-Make.html +Oxcaml-Include_functor-Make-argument-1-T.html diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 2fd47c8b7f..2562de5498 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -394,6 +394,11 @@ \subsubsection{Modes in type definitions\label{Oxcaml--modes-in-type-definitions \ocamlcodefragment{| \ocamltag{constructor}{Mc\_\allowbreak{}gadt} : (\ocamltag{type-var}{'a} @ once \ocamltag{arrow}{$\rightarrow$} \ocamltag{type-var}{'a}) \ocamltag{arrow}{$\rightarrow$} \hyperref[Oxcaml--type-mode_cstr]{\ocamlinlinecode{mode\_\allowbreak{}cstr}}}\label{Oxcaml--type-mode_cstr.Mc_gadt}& GADT constructor\\ \end{ocamltabular}% \\ +\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}}\\ +\label{Oxcaml-Include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ \input{Oxcaml.F_with.tex} \input{Oxcaml.X_with.tex} diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index 52ec09429d..c2429aa27c 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11956,7 +11956,10 @@ Oxcaml-module-type-S.html.gen Oxcaml-M1.html.gen Oxcaml-M2.html.gen - Oxcaml-M3.html.gen) + Oxcaml-M3.html.gen + Oxcaml-Include_functor.html.gen + Oxcaml-Include_functor-Make.html.gen + Oxcaml-Include_functor-Make-argument-1-T.html.gen) (package odoc) (action (run @@ -12031,6 +12034,28 @@ (package odoc) (action (diff Oxcaml-M3.html Oxcaml-M3.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}))) (subdir @@ -12114,7 +12139,9 @@ Oxcaml.X_with.3o.gen Oxcaml.M1.3o.gen Oxcaml.M2.3o.gen - Oxcaml.M3.3o.gen) + Oxcaml.M3.3o.gen + Oxcaml.Include_functor.3o.gen + Oxcaml.Include_functor.Make.3o.gen) (package odoc) (action (run odoc man-generate -o . --extra-suffix gen %{dep:../oxcaml.odocl})) @@ -12160,6 +12187,18 @@ (package odoc) (action (diff Oxcaml.M3.3o Oxcaml.M3.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}))) (subdir @@ -12192,7 +12231,10 @@ Oxcaml-module-type-S.md.gen Oxcaml-M1.md.gen Oxcaml-M2.md.gen - Oxcaml-M3.md.gen) + Oxcaml-M3.md.gen + Oxcaml-Include_functor.md.gen + Oxcaml-Include_functor-Make.md.gen + Oxcaml-Include_functor-Make-argument-1-T.md.gen) (package odoc) (action (run @@ -12263,6 +12305,26 @@ (package odoc) (action (diff Oxcaml-M3.md Oxcaml-M3.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}))) (subdir diff --git a/test/generators/man/Oxcaml.3o b/test/generators/man/Oxcaml.3o index 29463c801c..c822fa25c3 100644 --- a/test/generators/man/Oxcaml.3o +++ b/test/generators/man/Oxcaml.3o @@ -1197,4 +1197,5 @@ fn_both : int @ local \f[CB]\->\fR int @ local; .ti +4 (* GADT constructor *) .br - +.sp +\f[CB]module\fR Include_functor : \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..91667a49b7 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor.3o @@ -0,0 +1,18 @@ + +.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 +.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..0a52767dec --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor.Make.3o @@ -0,0 +1,30 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor\.Make +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor\.Make\fR +.in +.sp +.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.targets b/test/generators/man/oxcaml.targets index 4ed49cfa3b..b344a86e06 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -5,3 +5,5 @@ Oxcaml.X_with.3o Oxcaml.M1.3o Oxcaml.M2.3o Oxcaml.M3.3o +Oxcaml.Include_functor.3o +Oxcaml.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..717336f028 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor-Make.md @@ -0,0 +1,15 @@ + +# Module `Include_functor.Make` + + +## 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..77b7d949e4 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor.md @@ -0,0 +1,12 @@ + +# Module `Oxcaml.Include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +```ocaml +type t +``` +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml.md b/test/generators/markdown/Oxcaml.md index 0dfa5474f6..3647abd513 100644 --- a/test/generators/markdown/Oxcaml.md +++ b/test/generators/markdown/Oxcaml.md @@ -694,4 +694,7 @@ type mode_cstr = | Mc_arrow of int @ local -> int (* Constructor argument is a parenthesized arrow with a mode. *) | Mc_nested of (int @ local -> int) -> unit (* Nested arrow: higher-order with a mode on the inner argument. *) | Mc_gadt : ('a @ once -> 'a) -> mode_cstr (* GADT constructor *) +``` +```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 c557e07cc6..b7894bcbb8 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -8,3 +8,6 @@ Oxcaml-module-type-S.md Oxcaml-M1.md Oxcaml-M2.md Oxcaml-M3.md +Oxcaml-Include_functor.md +Oxcaml-Include_functor-Make.md +Oxcaml-Include_functor-Make-argument-1-T.md From 98ba0ae09e4b2fdd79d4e6f38585c76747a09ab5 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Thu, 11 Jun 2026 15:36:36 +0200 Subject: [PATCH 02/23] Add non-include-functor version for comparison Signed-off-by: Marek Kubica --- test/generators/cases/oxcaml.mli | 12 +++ ...-No_include_functor-Make-argument-1-T.html | 29 ++++++ .../html/Oxcaml-No_include_functor-Make.html | 51 ++++++++++ .../html/Oxcaml-No_include_functor-T.html | 29 ++++++ .../html/Oxcaml-No_include_functor.html | 92 +++++++++++++++++++ test/generators/html/Oxcaml.html | 21 +++++ test/generators/html/oxcaml.targets | 4 + test/generators/latex/Oxcaml.tex | 9 ++ test/generators/link.dune.inc | 89 ++++++++++++++++++ test/generators/man/Oxcaml.3o | 6 ++ .../man/Oxcaml.No_include_functor.3o | 20 ++++ .../man/Oxcaml.No_include_functor.Make.3o | 30 ++++++ .../man/Oxcaml.No_include_functor.T.3o | 14 +++ test/generators/man/oxcaml.targets | 3 + ...ml-No_include_functor-Make-argument-1-T.md | 6 ++ .../Oxcaml-No_include_functor-Make.md | 15 +++ .../markdown/Oxcaml-No_include_functor-T.md | 6 ++ .../markdown/Oxcaml-No_include_functor.md | 15 +++ test/generators/markdown/Oxcaml.md | 6 ++ test/generators/markdown/oxcaml.targets | 4 + 20 files changed, 461 insertions(+) create mode 100644 test/generators/html/Oxcaml-No_include_functor-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-No_include_functor-Make.html create mode 100644 test/generators/html/Oxcaml-No_include_functor-T.html create mode 100644 test/generators/html/Oxcaml-No_include_functor.html create mode 100644 test/generators/man/Oxcaml.No_include_functor.3o create mode 100644 test/generators/man/Oxcaml.No_include_functor.Make.3o create mode 100644 test/generators/man/Oxcaml.No_include_functor.T.3o create mode 100644 test/generators/markdown/Oxcaml-No_include_functor-Make-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-No_include_functor-Make.md create mode 100644 test/generators/markdown/Oxcaml-No_include_functor-T.md create mode 100644 test/generators/markdown/Oxcaml-No_include_functor.md diff --git a/test/generators/cases/oxcaml.mli b/test/generators/cases/oxcaml.mli index 8c34d0e974..5df22eff18 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -518,6 +518,18 @@ type mode_cstr = | Mc_gadt : ('a @ once -> 'a) -> mode_cstr (** GADT constructor *) +(** {1 Include functor on signatures} *) + +module No_include_functor : sig + 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 Make (T : sig type t end) : sig type included end type t 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..aff06ab0bd --- /dev/null +++ b/test/generators/html/Oxcaml-No_include_functor-Make.html @@ -0,0 +1,51 @@ + + + Make (Oxcaml.No_include_functor.Make) + + + + + + + + +
+

Module No_include_functor.Make

+
+
+ +
+
+

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..549444643e --- /dev/null +++ b/test/generators/html/Oxcaml-No_include_functor.html @@ -0,0 +1,92 @@ + + + No_include_functor (Oxcaml.No_include_functor) + + + + + + + + +
+

Module Oxcaml.No_include_functor

+
+
+
+
+ + + module + Make + + ( + T + : sig ... + end) : sig + ... end + + +
+
+
+
+ + + 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 a60193044a..4aac3c8a57 100644 --- a/test/generators/html/Oxcaml.html +++ b/test/generators/html/Oxcaml.html @@ -85,6 +85,10 @@

Module Oxcaml

+
  • + Include functor on signatures + +
  • @@ -2254,6 +2258,23 @@

    +

    + Include + functor on signatures +

    +
    +
    + + + module + No_include_functor + + : sig ... + end + + +
    +
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index e650d68fe0..e3e5784411 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -8,6 +8,10 @@ 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 diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 2562de5498..d4549de436 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -394,6 +394,15 @@ \subsubsection{Modes in type definitions\label{Oxcaml--modes-in-type-definitions \ocamlcodefragment{| \ocamltag{constructor}{Mc\_\allowbreak{}gadt} : (\ocamltag{type-var}{'a} @ once \ocamltag{arrow}{$\rightarrow$} \ocamltag{type-var}{'a}) \ocamltag{arrow}{$\rightarrow$} \hyperref[Oxcaml--type-mode_cstr]{\ocamlinlinecode{mode\_\allowbreak{}cstr}}}\label{Oxcaml--type-mode_cstr.Mc_gadt}& GADT constructor\\ \end{ocamltabular}% \\ +\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}}\\ +\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}}\\ \label{Oxcaml-Include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \label{Oxcaml-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index c2429aa27c..cf9febeb9c 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11957,6 +11957,10 @@ Oxcaml-M1.html.gen Oxcaml-M2.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) @@ -12035,6 +12039,36 @@ (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) @@ -12140,6 +12174,9 @@ 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) (package odoc) @@ -12188,6 +12225,26 @@ (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) @@ -12232,6 +12289,10 @@ Oxcaml-M1.md.gen Oxcaml-M2.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) @@ -12306,6 +12367,34 @@ (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) diff --git a/test/generators/man/Oxcaml.3o b/test/generators/man/Oxcaml.3o index c822fa25c3..b81fa61a14 100644 --- a/test/generators/man/Oxcaml.3o +++ b/test/generators/man/Oxcaml.3o @@ -1198,4 +1198,10 @@ fn_both : int @ local \f[CB]\->\fR int @ local; (* GADT constructor *) .br .sp +.in 3 +\fB16 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 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..b2604f7274 --- /dev/null +++ b/test/generators/man/Oxcaml.No_include_functor.3o @@ -0,0 +1,20 @@ + +.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 +.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..094a4e7ce1 --- /dev/null +++ b/test/generators/man/Oxcaml.No_include_functor.Make.3o @@ -0,0 +1,30 @@ + +.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 +.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.targets b/test/generators/man/oxcaml.targets index b344a86e06..2cd5752d5f 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -5,5 +5,8 @@ Oxcaml.X_with.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 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..552520f632 --- /dev/null +++ b/test/generators/markdown/Oxcaml-No_include_functor-Make.md @@ -0,0 +1,15 @@ + +# Module `No_include_functor.Make` + + +## 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..3f948350f1 --- /dev/null +++ b/test/generators/markdown/Oxcaml-No_include_functor.md @@ -0,0 +1,15 @@ + +# Module `Oxcaml.No_include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +```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 3647abd513..b90377fd88 100644 --- a/test/generators/markdown/Oxcaml.md +++ b/test/generators/markdown/Oxcaml.md @@ -695,6 +695,12 @@ type mode_cstr = | Mc_nested of (int @ local -> int) -> unit (* Nested arrow: higher-order with a mode on the inner argument. *) | Mc_gadt : ('a @ once -> 'a) -> mode_cstr (* GADT constructor *) ``` + +## Include functor on signatures + +```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 b7894bcbb8..96d91e2bb1 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -8,6 +8,10 @@ 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 From 2e97b5aad37fe7a9ed60fe35bcac9a9f800e41fc Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Fri, 12 Jun 2026 16:18:09 +0200 Subject: [PATCH 03/23] Add "include functor" rendering --- src/document/generator.ml | 14 +++++++++---- src/loader/cmti.ml | 10 ++++++++- src/model/lang.ml | 5 +++-- src/model_desc/lang_desc.ml | 1 + src/xref2/compile.ml | 9 +++++++- src/xref2/component.ml | 4 +++- src/xref2/component.mli | 2 +- src/xref2/lang_of.ml | 1 + src/xref2/link.ml | 2 ++ src/xref2/subst.ml | 1 + src/xref2/tools.ml | 10 +++++++++ src/xref2/tools.mli | 2 ++ .../html/Oxcaml-Include_functor.html | 21 ++++++++++++++----- test/generators/latex/Oxcaml.tex | 2 +- 14 files changed, 68 insertions(+), 16 deletions(-) diff --git a/src/document/generator.ml b/src/document/generator.ml index f8efd42ef8..ed6ead0046 100644 --- a/src/document/generator.ml +++ b/src/document/generator.ml @@ -1912,7 +1912,7 @@ 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)) + | Alias p | Functor p -> Paths.Path.(is_hidden (p :> t)) | ModuleType mty -> umty_hidden mty in let status = if decl_hidden then `Inline else t.status in @@ -1921,14 +1921,20 @@ 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 -> + O.keyword "include", Link.from_path (mod_path :> Paths.Path.t) - | ModuleType mt -> umty mt + | Functor mod_path -> + O.keyword "include functor", + Link.from_path (mod_path :> Paths.Path.t) + | 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/cmti.ml b/src/loader/cmti.ml index fba321a21e..cbffce275e 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -918,8 +918,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 p = match uexpr with + | TypeOf (ModPath p, _) -> p + | _ -> failwith "We expected TypeOf with a ModPath but got something else" + in + let decl = Include.Functor p 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 9dabb70404..ba749b8558 100644 --- a/src/model/lang.ml +++ b/src/model/lang.ml @@ -196,7 +196,7 @@ and Include : sig type expansion = { shadowed : shadowed; content : Signature.t } (* 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 Path.Module.t type t = { loc : Location_.span; @@ -639,7 +639,8 @@ 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 p; _ } -> Paths.Path.is_hidden (p :> Path.t) | { 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 f09fad15bb..43c8c757fb 100644 --- a/src/model_desc/lang_desc.ml +++ b/src/model_desc/lang_desc.ml @@ -293,6 +293,7 @@ and include_decl = Variant (function | Alias p -> C ("Alias", (p :> Paths.Path.t), path) + | Functor p -> C ("Functor", (p :> Paths.Path.t), path) | ModuleType e -> C ("ModuleType", e, moduletype_u_expr)) and include_expansion = diff --git a/src/xref2/compile.ml b/src/xref2/compile.ml index 3c64d74b2b..4d4c156cf1 100644 --- a/src/xref2/compile.ml +++ b/src/xref2/compile.ml @@ -389,6 +389,9 @@ 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 p -> + (* TODO deduplicate *) + Functor (module_path env p) | Alias p -> Alias (module_path env p) and module_type : Env.t -> ModuleType.t -> ModuleType.t = @@ -410,10 +413,14 @@ and include_ : Env.t -> Include.t -> Include.t * Env.t = match let open Odoc_utils.ResultMonad in match decl with + | Functor p -> + Tools.expansion_of_module_path env ~strengthen:true p >>= fun exp -> + Tools.assert_functor exp | 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 with | Error e -> Errors.report ~what:(`Include decl) ~tools_error:e `Expand; diff --git a/src/xref2/component.ml b/src/xref2/component.ml index f132b56729..3c095b0947 100644 --- a/src/xref2/component.ml +++ b/src/xref2/component.ml @@ -367,7 +367,7 @@ end = Open and Include : sig - type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr + type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr | Functor of Cpath.module_ type t = { parent : Odoc_model.Paths.Identifier.Signature.t; @@ -927,6 +927,7 @@ module Fmt = struct let open Include in function | Alias p -> Format.fprintf ppf "%a" (module_path c) p + | Functor p -> Format.fprintf ppf "functor %a" (module_path c) p | ModuleType mt -> Format.fprintf ppf "%a" (u_module_type_expr c) mt and value c ppf v = @@ -2416,6 +2417,7 @@ 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 p -> Functor (module_path ident_map p) | 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 d9e25394ff..50d8c326ec 100644 --- a/src/xref2/component.mli +++ b/src/xref2/component.mli @@ -339,7 +339,7 @@ and Open : sig end and Include : sig - type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr + type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr | Functor of Cpath.module_ type t = { parent : Odoc_model.Paths.Identifier.Signature.t; diff --git a/src/xref2/lang_of.ml b/src/xref2/lang_of.ml index 796bad42e3..79a699743b 100644 --- a/src/xref2/lang_of.ml +++ b/src/xref2/lang_of.ml @@ -651,6 +651,7 @@ and include_decl : (* Don't start shadowing within any signatures *) match d with | Alias p -> Alias (Path.module_ map p) + | Functor p -> Functor (Path.module_ map p) | 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 2620a49065..f380355ba1 100644 --- a/src/xref2/link.ml +++ b/src/xref2/link.ml @@ -707,6 +707,8 @@ 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) + (* TODO dedup *) + | Functor p -> Functor (module_path env p) | Alias p -> Alias (module_path env p) and module_type : Env.t -> ModuleType.t -> ModuleType.t = diff --git a/src/xref2/subst.ml b/src/xref2/subst.ml index 5a90ef98cb..2358c36ac0 100644 --- a/src/xref2/subst.ml +++ b/src/xref2/subst.ml @@ -760,6 +760,7 @@ and module_decl s t = and include_decl s t = match t with | Include.Alias p -> Include.Alias (module_path s p) + | Functor p -> Functor (module_path s p) | 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 8f3964c584..c2b416d407 100644 --- a/src/xref2/tools.ml +++ b/src/xref2/tools.ml @@ -1577,6 +1577,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 @@ -1803,6 +1809,10 @@ 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)) + | Functor p -> + expansion_of_module_path env ~strengthen:true p >>= assert_functor + >>= fun sg -> + fragmap env subst sg >>= fun sg -> Ok (ModuleType (Signature sg)) | ModuleType mty' -> Ok (ModuleType (With ([ subst ], mty'))) in let map_module m new_subst = diff --git a/src/xref2/tools.mli b/src/xref2/tools.mli index 81c1322c42..7b3fb06647 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 -> diff --git a/test/generators/html/Oxcaml-Include_functor.html b/test/generators/html/Oxcaml-Include_functor.html index f964624cb1..18eaf5f364 100644 --- a/test/generators/html/Oxcaml-Include_functor.html +++ b/test/generators/html/Oxcaml-Include_functor.html @@ -37,11 +37,22 @@

    Module Oxcaml.Include_functor

    type t
    -
    -
    - - type included -
    +
    +
    + + + include functor + Make + + + +
    +
    + + type included +
    +
    +
    diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index d4549de436..3b6cd2536b 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -405,7 +405,7 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \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}}\\ \label{Oxcaml-Include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\label{Oxcaml-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\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}}\\ From 7e4ff5df052444573f3f9f88777b3e794c48bc8d Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Tue, 23 Jun 2026 14:44:19 +0200 Subject: [PATCH 04/23] Add example for include functor in structs Signed-off-by: Marek Kubica --- test/generators/cases/oxcaml_impl.ml | 18 ++ ...mpl-Include_functor-Make-argument-1-T.html | 31 ++++ .../Oxcaml_impl-Include_functor-Make.html | 52 ++++++ .../html/Oxcaml_impl-Include_functor.html | 49 +++++ ...-No_include_functor-Make-argument-1-T.html | 31 ++++ .../Oxcaml_impl-No_include_functor-Make.html | 52 ++++++ .../Oxcaml_impl-No_include_functor-T.html | 29 +++ .../html/Oxcaml_impl-No_include_functor.html | 98 ++++++++++ test/generators/html/Oxcaml_impl.html | 34 ++++ test/generators/html/oxcaml_impl.targets | 7 + test/generators/latex/Oxcaml_impl.tex | 14 ++ test/generators/link.dune.inc | 173 +++++++++++++++++- test/generators/man/Oxcaml_impl.3o | 9 +- .../man/Oxcaml_impl.Include_functor.3o | 18 ++ .../man/Oxcaml_impl.Include_functor.Make.3o | 30 +++ .../man/Oxcaml_impl.No_include_functor.3o | 20 ++ .../Oxcaml_impl.No_include_functor.Make.3o | 30 +++ .../man/Oxcaml_impl.No_include_functor.T.3o | 14 ++ test/generators/man/oxcaml_impl.targets | 5 + ..._impl-Include_functor-Make-argument-1-T.md | 6 + .../Oxcaml_impl-Include_functor-Make.md | 15 ++ .../markdown/Oxcaml_impl-Include_functor.md | 12 ++ ...pl-No_include_functor-Make-argument-1-T.md | 6 + .../Oxcaml_impl-No_include_functor-Make.md | 15 ++ .../Oxcaml_impl-No_include_functor-T.md | 6 + .../Oxcaml_impl-No_include_functor.md | 15 ++ test/generators/markdown/Oxcaml_impl.md | 10 + test/generators/markdown/oxcaml_impl.targets | 7 + 28 files changed, 802 insertions(+), 4 deletions(-) create mode 100644 test/generators/html/Oxcaml_impl-Include_functor-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml_impl-Include_functor-Make.html create mode 100644 test/generators/html/Oxcaml_impl-Include_functor.html create mode 100644 test/generators/html/Oxcaml_impl-No_include_functor-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml_impl-No_include_functor-Make.html create mode 100644 test/generators/html/Oxcaml_impl-No_include_functor-T.html create mode 100644 test/generators/html/Oxcaml_impl-No_include_functor.html create mode 100644 test/generators/man/Oxcaml_impl.Include_functor.3o create mode 100644 test/generators/man/Oxcaml_impl.Include_functor.Make.3o create mode 100644 test/generators/man/Oxcaml_impl.No_include_functor.3o create mode 100644 test/generators/man/Oxcaml_impl.No_include_functor.Make.3o create mode 100644 test/generators/man/Oxcaml_impl.No_include_functor.T.3o create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor-Make-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor-Make.md create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor.md create mode 100644 test/generators/markdown/Oxcaml_impl-No_include_functor-Make-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md create mode 100644 test/generators/markdown/Oxcaml_impl-No_include_functor-T.md create mode 100644 test/generators/markdown/Oxcaml_impl-No_include_functor.md diff --git a/test/generators/cases/oxcaml_impl.ml b/test/generators/cases/oxcaml_impl.ml index 3d605794d5..056178e528 100644 --- a/test/generators/cases/oxcaml_impl.ml +++ b/test/generators/cases/oxcaml_impl.ml @@ -59,3 +59,21 @@ let mode_arg : int @ local -> int = fun x -> x let mode_multi : string @ local once -> string @ local once = fun x -> x (** Multiple modes on argument and return. *) + +(** {1 Include functor on structures} *) + +module No_include_functor = struct + 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 + module Make (T : sig type t end) = struct type included end + type t + include functor Make +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..63fd3d57ca --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor-Make.html @@ -0,0 +1,52 @@ + + + Make (Oxcaml_impl.Include_functor.Make) + + + + + + + + +
    +

    Module Include_functor.Make

    +
    +
    + +
    +
    +

    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..b991958ed1 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor.html @@ -0,0 +1,49 @@ + + + Include_functor (Oxcaml_impl.Include_functor) + + + + + + + + +
    +

    Module Oxcaml_impl.Include_functor

    +
    +
    +
    +
    + + + module + Make + + ( + T + : sig ... + end) : sig + ... end + + +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + 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..f27582db18 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-No_include_functor-Make.html @@ -0,0 +1,52 @@ + + + Make (Oxcaml_impl.No_include_functor.Make) + + + + + + + + +
    +

    Module No_include_functor.Make

    +
    +
    + +
    +
    +

    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..66f5244334 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-No_include_functor.html @@ -0,0 +1,98 @@ + + + No_include_functor (Oxcaml_impl.No_include_functor) + + + + + + + + +
    +

    Module Oxcaml_impl.No_include_functor

    +
    +
    +
    +
    + + + module + Make + + ( + T + : sig ... + end) : sig + ... end + + +
    +
    +
    +
    + + + 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 9fde4ca6d5..068b28dfa5 100644 --- a/test/generators/html/Oxcaml_impl.html +++ b/test/generators/html/Oxcaml_impl.html @@ -36,6 +36,10 @@

    Module Oxcaml_impl

  • Modes on values
  • +
  • + Include functor on structures + +
  • @@ -318,6 +322,36 @@

    Multiple modes on argument and return.

    +

    + Include + functor on structures +

    +
    +
    + + + module + No_include_functor + + : sig ... + end + + +
    +
    +
    +
    + + + module + Include_functor + + : sig ... + end + + +
    +
    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_impl.tex b/test/generators/latex/Oxcaml_impl.tex index ef632140c6..e773ce91a8 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -44,5 +44,19 @@ \subsubsection{Modes on values\label{Oxcaml_impl--modes-on-values}}% \medbreak \label{Oxcaml_impl--val-mode_multi}\ocamlcodefragment{\ocamltag{keyword}{val} mode\_\allowbreak{}multi : string @ local once \ocamltag{arrow}{$\rightarrow$} string @ local once}\begin{ocamlindent}Multiple modes on argument and return.\end{ocamlindent}% \medbreak +\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}}\\ +\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}}\\ +\label{Oxcaml_impl-Include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\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 cf9febeb9c..e36686cc64 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -12439,7 +12439,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 @@ -12470,6 +12477,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 @@ -12534,7 +12597,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 @@ -12563,6 +12631,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 @@ -12588,7 +12694,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 @@ -12617,6 +12730,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_impl.3o b/test/generators/man/Oxcaml_impl.3o index 2db71c4dbb..88cc13a9fd 100644 --- a/test/generators/man/Oxcaml_impl.3o +++ b/test/generators/man/Oxcaml_impl.3o @@ -143,4 +143,11 @@ Mode on a function argument, via a type annotation\. .ti +2 Multiple modes on argument and return\. .nf - +.sp +.in 3 +\fB3 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..13ecc3dc04 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Include_functor.3o @@ -0,0 +1,18 @@ + +.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 +.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..c65b57ad93 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Include_functor.Make.3o @@ -0,0 +1,30 @@ + +.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 +.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..f5f9d6b80b --- /dev/null +++ b/test/generators/man/Oxcaml_impl.No_include_functor.3o @@ -0,0 +1,20 @@ + +.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 +.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..117a283d5c --- /dev/null +++ b/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o @@ -0,0 +1,30 @@ + +.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 +.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_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_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..717336f028 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md @@ -0,0 +1,15 @@ + +# Module `Include_functor.Make` + + +## 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..854486cfe2 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor.md @@ -0,0 +1,12 @@ + +# Module `Oxcaml_impl.Include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +```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..552520f632 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md @@ -0,0 +1,15 @@ + +# Module `No_include_functor.Make` + + +## 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..1ad27ff002 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor.md @@ -0,0 +1,15 @@ + +# Module `Oxcaml_impl.No_include_functor` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +```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 6504572984..f3f3e9b4de 100644 --- a/test/generators/markdown/Oxcaml_impl.md +++ b/test/generators/markdown/Oxcaml_impl.md @@ -70,3 +70,13 @@ Mode on a function argument, via a type annotation. val mode_multi : string @ local once -> string @ local once ``` Multiple modes on argument and return. + + +## 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_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 From 5757d21222cf9c03b806fe96b255fb6ea733c4d9 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Wed, 24 Jun 2026 11:01:38 +0200 Subject: [PATCH 05/23] Implement reference to include functor --- src/loader/cmt.ml | 15 +++++++------ .../html/Oxcaml_impl-Include_functor.html | 21 ++++++++++++++----- test/generators/latex/Oxcaml_impl.tex | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 5c225a6c8b..3620dea274 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -581,26 +581,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 p in + [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] | _ -> content.items diff --git a/test/generators/html/Oxcaml_impl-Include_functor.html b/test/generators/html/Oxcaml_impl-Include_functor.html index b991958ed1..4f04c241a4 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor.html +++ b/test/generators/html/Oxcaml_impl-Include_functor.html @@ -38,11 +38,22 @@

    Module Oxcaml_impl.Include_functor

    type t -
    -
    - - type included -
    +
    +
    + + + include functor + Make + + + +
    +
    + + type included +
    +
    +
    diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index e773ce91a8..0ba7f557d5 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -55,7 +55,7 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \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}}\\ \label{Oxcaml_impl-Include_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\label{Oxcaml_impl-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\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}}\\ From ab8bcec35e211daaf5230cd324dc4ecc30802dd9 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Tue, 30 Jun 2026 10:31:13 +0200 Subject: [PATCH 06/23] Allow `include functor` with a module expression --- src/document/generator.ml | 18 ++--- src/loader/cmt.ml | 2 +- src/loader/cmti.ml | 8 +- src/model/lang.ml | 12 ++- src/model_desc/lang_desc.ml | 3 +- src/xref2/compile.ml | 19 +++-- src/xref2/component.ml | 14 +++- src/xref2/component.mli | 6 +- src/xref2/lang_of.ml | 5 +- src/xref2/link.ml | 13 +++- src/xref2/subst.ml | 3 +- src/xref2/tools.ml | 25 +++++-- src/xref2/tools.mli | 1 + test/generators/cases/oxcaml.mli | 10 +++ test/generators/cases/oxcaml_impl.ml | 3 + .../html/Oxcaml-Include_functor-Make.html | 3 + .../html/Oxcaml-Include_functor.html | 5 ++ ...ed_type-module-type-Make-argument-1-_.html | 33 +++++++++ ...e_functor_named_type-module-type-Make.html | 58 +++++++++++++++ .../Oxcaml-Include_functor_named_type.html | 74 +++++++++++++++++++ .../html/Oxcaml-No_include_functor-Make.html | 3 + .../html/Oxcaml-No_include_functor.html | 5 ++ test/generators/html/Oxcaml.html | 15 ++++ .../Oxcaml_impl-Include_functor-Make.html | 3 + .../html/Oxcaml_impl-Include_functor.html | 5 ++ .../Oxcaml_impl-No_include_functor-Make.html | 4 + .../html/Oxcaml_impl-No_include_functor.html | 6 ++ test/generators/html/oxcaml.targets | 3 + test/generators/latex/Oxcaml.tex | 19 ++++- test/generators/latex/Oxcaml_impl.tex | 6 +- test/generators/link.dune.inc | 69 ++++++++++++++++- test/generators/man/Oxcaml.3o | 2 + test/generators/man/Oxcaml.Include_functor.3o | 5 ++ .../man/Oxcaml.Include_functor.Make.3o | 3 + .../man/Oxcaml.Include_functor_named_type.3o | 45 +++++++++++ .../man/Oxcaml.No_include_functor.3o | 5 ++ .../man/Oxcaml.No_include_functor.Make.3o | 3 + .../man/Oxcaml_impl.Include_functor.3o | 5 ++ .../man/Oxcaml_impl.Include_functor.Make.3o | 3 + .../man/Oxcaml_impl.No_include_functor.3o | 5 ++ .../Oxcaml_impl.No_include_functor.Make.3o | 3 + test/generators/man/oxcaml.targets | 1 + .../markdown/Oxcaml-Include_functor-Make.md | 2 + .../markdown/Oxcaml-Include_functor.md | 2 + ...amed_type-module-type-Make-argument-1-_.md | 6 ++ ...ude_functor_named_type-module-type-Make.md | 17 +++++ .../Oxcaml-Include_functor_named_type.md | 14 ++++ .../Oxcaml-No_include_functor-Make.md | 2 + .../markdown/Oxcaml-No_include_functor.md | 2 + test/generators/markdown/Oxcaml.md | 3 + .../Oxcaml_impl-Include_functor-Make.md | 2 + .../markdown/Oxcaml_impl-Include_functor.md | 2 + .../Oxcaml_impl-No_include_functor-Make.md | 2 + .../Oxcaml_impl-No_include_functor.md | 2 + test/generators/markdown/oxcaml.targets | 3 + 55 files changed, 541 insertions(+), 51 deletions(-) create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type-module-type-Make.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type.html create mode 100644 test/generators/man/Oxcaml.Include_functor_named_type.3o create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type.md diff --git a/src/document/generator.ml b/src/document/generator.ml index ed6ead0046..02679c8886 100644 --- a/src/document/generator.ml +++ b/src/document/generator.ml @@ -1912,8 +1912,8 @@ module Make (Syntax : SYNTAX) = struct and include_ (t : Odoc_model.Lang.Include.t) = let decl_hidden = match t.decl with - | Alias p | Functor 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 @@ -1924,14 +1924,12 @@ module Make (Syntax : SYNTAX) = struct let include_kw, include_decl = match t.decl with | Odoc_model.Lang.Include.Alias mod_path -> - O.keyword "include", - Link.from_path (mod_path :> Paths.Path.t) - | Functor mod_path -> - O.keyword "include functor", - Link.from_path (mod_path :> Paths.Path.t) - | ModuleType mt -> - O.keyword "include", - 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 (include_kw ++ O.txt " " ++ include_decl diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 3620dea274..a2bf3453ac 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -602,7 +602,7 @@ and read_include env parent incl = let decl = ModuleType m in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] | Some `Functor p -> - let decl = Include.Functor p in + 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 cbffce275e..eb9680112b 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -920,11 +920,11 @@ and read_include env parent incl = [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] #if defined OXCAML | Some uexpr, (Tincl_functor _ | Tincl_gen_functor _) -> - let p = match uexpr with - | TypeOf (ModPath p, _) -> p - | _ -> failwith "We expected TypeOf with a ModPath but got something else" + 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 - let decl = Include.Functor p in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] #endif | _ -> diff --git a/src/model/lang.ml b/src/model/lang.ml index ba749b8558..eff11be1cf 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 | Functor of Path.Module.t + type decl = + | Alias of Path.Module.t + | ModuleType of ModuleType.U.expr + | Functor of functor' type t = { loc : Location_.span; @@ -639,8 +644,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; _ } - | { decl = Functor 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 43c8c757fb..065e5e42d0 100644 --- a/src/model_desc/lang_desc.ml +++ b/src/model_desc/lang_desc.ml @@ -293,7 +293,8 @@ and include_decl = Variant (function | Alias p -> C ("Alias", (p :> Paths.Path.t), path) - | Functor p -> C ("Functor", (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 4d4c156cf1..92af14fda2 100644 --- a/src/xref2/compile.ml +++ b/src/xref2/compile.ml @@ -389,9 +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 p -> - (* TODO deduplicate *) - Functor (module_path env p) + | 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 = @@ -413,14 +414,16 @@ and include_ : Env.t -> Include.t -> Include.t * Env.t = match let open Odoc_utils.ResultMonad in match decl with - | Functor p -> + | 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; @@ -646,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 3c095b0947..1bceeefcf9 100644 --- a/src/xref2/component.ml +++ b/src/xref2/component.ml @@ -367,7 +367,11 @@ end = Open and Include : sig - type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr | Functor of Cpath.module_ + 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; @@ -927,7 +931,9 @@ module Fmt = struct let open Include in function | Alias p -> Format.fprintf ppf "%a" (module_path c) p - | Functor p -> Format.fprintf ppf "functor %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 = @@ -2417,7 +2423,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 p -> Functor (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 50d8c326ec..2ebf3f342f 100644 --- a/src/xref2/component.mli +++ b/src/xref2/component.mli @@ -339,7 +339,11 @@ and Open : sig end and Include : sig - type decl = Alias of Cpath.module_ | ModuleType of ModuleType.U.expr | Functor of Cpath.module_ + 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 79a699743b..4f62f10a49 100644 --- a/src/xref2/lang_of.ml +++ b/src/xref2/lang_of.ml @@ -651,7 +651,10 @@ and include_decl : (* Don't start shadowing within any signatures *) match d with | Alias p -> Alias (Path.module_ map p) - | Functor p -> Functor (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 f380355ba1..3cd4d2d5a5 100644 --- a/src/xref2/link.ml +++ b/src/xref2/link.ml @@ -707,8 +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) - (* TODO dedup *) - | Functor p -> Functor (module_path env p) + | 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 = @@ -900,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 -> @@ -947,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 2358c36ac0..bfb5706310 100644 --- a/src/xref2/subst.ml +++ b/src/xref2/subst.ml @@ -760,7 +760,8 @@ and module_decl s t = and include_decl s t = match t with | Include.Alias p -> Include.Alias (module_path s p) - | Functor p -> Functor (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 c2b416d407..7716d50e7c 100644 --- a/src/xref2/tools.ml +++ b/src/xref2/tools.ml @@ -1618,22 +1618,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 : @@ -1664,7 +1670,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)) @@ -1678,7 +1685,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) @@ -1809,11 +1817,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)) - | Functor p -> + | 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)) - | ModuleType mty' -> Ok (ModuleType (With ([ subst ], mty'))) + | 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 7b3fb06647..b381c1534e 100644 --- a/src/xref2/tools.mli +++ b/src/xref2/tools.mli @@ -242,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 5df22eff18..0ee36a673f 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -521,6 +521,8 @@ type mode_cstr = (** {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 @@ -531,7 +533,15 @@ module No_include_functor : sig 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 056178e528..39366b13b4 100644 --- a/test/generators/cases/oxcaml_impl.ml +++ b/test/generators/cases/oxcaml_impl.ml @@ -63,6 +63,8 @@ let mode_multi : string @ local once -> string @ local once = fun x -> x (** {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 @@ -73,6 +75,7 @@ module No_include_functor = struct 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 diff --git a/test/generators/html/Oxcaml-Include_functor-Make.html b/test/generators/html/Oxcaml-Include_functor-Make.html index 2cc91dce29..1c5465d38c 100644 --- a/test/generators/html/Oxcaml-Include_functor-Make.html +++ b/test/generators/html/Oxcaml-Include_functor-Make.html @@ -15,6 +15,9 @@

    Module Include_functor.Make

    +

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

    +
    +

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

    +
    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.html b/test/generators/html/Oxcaml-No_include_functor-Make.html index aff06ab0bd..d8e38c5788 100644 --- a/test/generators/html/Oxcaml-No_include_functor-Make.html +++ b/test/generators/html/Oxcaml-No_include_functor-Make.html @@ -16,6 +16,9 @@

    Module No_include_functor.Make

    +

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

    +
    +

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

    +
    diff --git a/test/generators/html/Oxcaml.html b/test/generators/html/Oxcaml.html index 4aac3c8a57..83e5e966e5 100644 --- a/test/generators/html/Oxcaml.html +++ b/test/generators/html/Oxcaml.html @@ -2288,6 +2288,21 @@

    +
    +
    + + + module + + Include_functor_named_type + + + : sig ... + end + + +
    +
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor-Make.html b/test/generators/html/Oxcaml_impl-Include_functor-Make.html index 63fd3d57ca..a457eade36 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor-Make.html +++ b/test/generators/html/Oxcaml_impl-Include_functor-Make.html @@ -16,6 +16,9 @@

    Module Include_functor.Make

    +

    This module demonstratest the include functor + functionality +

    +
    +

    This module demonstratest the include functor + functionality +

    +
    diff --git a/test/generators/html/Oxcaml_impl-No_include_functor-Make.html b/test/generators/html/Oxcaml_impl-No_include_functor-Make.html index f27582db18..69ea651872 100644 --- a/test/generators/html/Oxcaml_impl-No_include_functor-Make.html +++ b/test/generators/html/Oxcaml_impl-No_include_functor-Make.html @@ -16,6 +16,10 @@

    Module No_include_functor.Make

    +

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

    +
    +

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

    +
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index e3e5784411..52678d074f 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -15,3 +15,6 @@ 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/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 3b6cd2536b..97f4a426fd 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -395,7 +395,8 @@ \subsubsection{Modes in type definitions\label{Oxcaml--modes-in-type-definitions \end{ocamltabular}% \\ \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}}\\ +\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}}\\ @@ -403,11 +404,25 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \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}}\\ +\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.F_with.tex} \input{Oxcaml.X_with.tex} diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index 0ba7f557d5..4f6feb9e3e 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -45,7 +45,8 @@ \subsubsection{Modes on values\label{Oxcaml_impl--modes-on-values}}% \label{Oxcaml_impl--val-mode_multi}\ocamlcodefragment{\ocamltag{keyword}{val} mode\_\allowbreak{}multi : string @ local once \ocamltag{arrow}{$\rightarrow$} string @ local once}\begin{ocamlindent}Multiple modes on argument and return.\end{ocamlindent}% \medbreak \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}}\\ +\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}}\\ @@ -53,7 +54,8 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \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}}\\ +\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}% diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index e36686cc64..7672cc95e1 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11963,7 +11963,10 @@ 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-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 @@ -12090,6 +12093,30 @@ (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 @@ -12178,7 +12205,8 @@ 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.Make.3o.gen + Oxcaml.Include_functor_named_type.3o.gen) (package odoc) (action (run odoc man-generate -o . --extra-suffix gen %{dep:../oxcaml.odocl})) @@ -12256,6 +12284,14 @@ (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 @@ -12295,7 +12331,10 @@ 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-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 @@ -12414,6 +12453,30 @@ (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 diff --git a/test/generators/man/Oxcaml.3o b/test/generators/man/Oxcaml.3o index b81fa61a14..89d88d63af 100644 --- a/test/generators/man/Oxcaml.3o +++ b/test/generators/man/Oxcaml.3o @@ -1205,3 +1205,5 @@ fn_both : int @ local \f[CB]\->\fR int @ local; \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 index 91667a49b7..a0776f720c 100644 --- a/test/generators/man/Oxcaml.Include_functor.3o +++ b/test/generators/man/Oxcaml.Include_functor.3o @@ -12,6 +12,11 @@ Oxcaml\.Include_functor .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 diff --git a/test/generators/man/Oxcaml.Include_functor.Make.3o b/test/generators/man/Oxcaml.Include_functor.Make.3o index 0a52767dec..a5217b11b7 100644 --- a/test/generators/man/Oxcaml.Include_functor.Make.3o +++ b/test/generators/man/Oxcaml.Include_functor.Make.3o @@ -8,6 +8,9 @@ Oxcaml\.Include_functor\.Make \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 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 index b2604f7274..d9b130cc57 100644 --- a/test/generators/man/Oxcaml.No_include_functor.3o +++ b/test/generators/man/Oxcaml.No_include_functor.3o @@ -12,6 +12,11 @@ Oxcaml\.No_include_functor .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 diff --git a/test/generators/man/Oxcaml.No_include_functor.Make.3o b/test/generators/man/Oxcaml.No_include_functor.Make.3o index 094a4e7ce1..6438bce203 100644 --- a/test/generators/man/Oxcaml.No_include_functor.Make.3o +++ b/test/generators/man/Oxcaml.No_include_functor.Make.3o @@ -8,6 +8,9 @@ Oxcaml\.No_include_functor\.Make \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 diff --git a/test/generators/man/Oxcaml_impl.Include_functor.3o b/test/generators/man/Oxcaml_impl.Include_functor.3o index 13ecc3dc04..ccdb31fa51 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor.3o @@ -12,6 +12,11 @@ Oxcaml_impl\.Include_functor .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 diff --git a/test/generators/man/Oxcaml_impl.Include_functor.Make.3o b/test/generators/man/Oxcaml_impl.Include_functor.Make.3o index c65b57ad93..de73e9d81e 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor.Make.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor.Make.3o @@ -8,6 +8,9 @@ Oxcaml_impl\.Include_functor\.Make \fBModule Include_functor\.Make\fR .in .sp +.fi +This module demonstratest the include functor functionality +.nf .SH Documentation .sp .nf diff --git a/test/generators/man/Oxcaml_impl.No_include_functor.3o b/test/generators/man/Oxcaml_impl.No_include_functor.3o index f5f9d6b80b..0c1058d355 100644 --- a/test/generators/man/Oxcaml_impl.No_include_functor.3o +++ b/test/generators/man/Oxcaml_impl.No_include_functor.3o @@ -12,6 +12,11 @@ Oxcaml_impl\.No_include_functor .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 diff --git a/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o b/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o index 117a283d5c..283ddc0e27 100644 --- a/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o +++ b/test/generators/man/Oxcaml_impl.No_include_functor.Make.3o @@ -8,6 +8,9 @@ Oxcaml_impl\.No_include_functor\.Make \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 diff --git a/test/generators/man/oxcaml.targets b/test/generators/man/oxcaml.targets index 2cd5752d5f..9b7fc4c496 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -10,3 +10,4 @@ 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/markdown/Oxcaml-Include_functor-Make.md b/test/generators/markdown/Oxcaml-Include_functor-Make.md index 717336f028..a131081dc7 100644 --- a/test/generators/markdown/Oxcaml-Include_functor-Make.md +++ b/test/generators/markdown/Oxcaml-Include_functor-Make.md @@ -1,6 +1,8 @@ # Module `Include_functor.Make` +Module which defines a functor and includes it via `module type of` + ## Parameters diff --git a/test/generators/markdown/Oxcaml-Include_functor.md b/test/generators/markdown/Oxcaml-Include_functor.md index 77b7d949e4..e54338a324 100644 --- a/test/generators/markdown/Oxcaml-Include_functor.md +++ b/test/generators/markdown/Oxcaml-Include_functor.md @@ -4,6 +4,8 @@ ```ocaml module Make (T : sig ... end) : sig ... end ``` +Module which defines a functor and includes it via `module type of` + ```ocaml type t ``` 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.md b/test/generators/markdown/Oxcaml-No_include_functor-Make.md index 552520f632..f6909af03f 100644 --- a/test/generators/markdown/Oxcaml-No_include_functor-Make.md +++ b/test/generators/markdown/Oxcaml-No_include_functor-Make.md @@ -1,6 +1,8 @@ # Module `No_include_functor.Make` +Module without any `include functor` features, this is how things are done in plain OCaml at the moment. + ## Parameters diff --git a/test/generators/markdown/Oxcaml-No_include_functor.md b/test/generators/markdown/Oxcaml-No_include_functor.md index 3f948350f1..c6228a22f0 100644 --- a/test/generators/markdown/Oxcaml-No_include_functor.md +++ b/test/generators/markdown/Oxcaml-No_include_functor.md @@ -4,6 +4,8 @@ ```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 ``` diff --git a/test/generators/markdown/Oxcaml.md b/test/generators/markdown/Oxcaml.md index b90377fd88..b52c1bc808 100644 --- a/test/generators/markdown/Oxcaml.md +++ b/test/generators/markdown/Oxcaml.md @@ -703,4 +703,7 @@ 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.md b/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md index 717336f028..6bb4b93f08 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md @@ -1,6 +1,8 @@ # Module `Include_functor.Make` +This module demonstratest the `include functor` functionality + ## Parameters diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor.md b/test/generators/markdown/Oxcaml_impl-Include_functor.md index 854486cfe2..0478033a7b 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor.md @@ -4,6 +4,8 @@ ```ocaml module Make (T : sig ... end) : sig ... end ``` +This module demonstratest the `include functor` functionality + ```ocaml type t ``` diff --git a/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md b/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md index 552520f632..81cbc7cb82 100644 --- a/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md @@ -1,6 +1,8 @@ # Module `No_include_functor.Make` +This module shows how to achieve the effect without `include functor`, with an intermediate module `T`. + ## Parameters diff --git a/test/generators/markdown/Oxcaml_impl-No_include_functor.md b/test/generators/markdown/Oxcaml_impl-No_include_functor.md index 1ad27ff002..10f6b8c8ab 100644 --- a/test/generators/markdown/Oxcaml_impl-No_include_functor.md +++ b/test/generators/markdown/Oxcaml_impl-No_include_functor.md @@ -4,6 +4,8 @@ ```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 ``` diff --git a/test/generators/markdown/oxcaml.targets b/test/generators/markdown/oxcaml.targets index 96d91e2bb1..65fbe6ca84 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -15,3 +15,6 @@ 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 From 9ca0701d9114e01d9171f044ad21b8a37cb96215 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Tue, 30 Jun 2026 14:36:18 +0200 Subject: [PATCH 07/23] Add changelog entry --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 6cb5bf928b..35497da123 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,8 @@ - Support OxCaml 5.2.0minus39 (@jonludlam, #1469) - Support for OxCaml modes (@art-w, #1454) - Fix OxCaml with-bounds for arbitrary types (@art-w, #1466) +- Display items included via `include functor` as included via the functor + (@Leonidas-from-XIV, #1452) ### Fixed - Remove requirement for ppx_expect in tests (@jonludlam, #1445) From 51efb2a8525b2eb4caf6a477e6d65f9bfc6aeded Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Thu, 9 Jul 2026 15:27:55 +0200 Subject: [PATCH 08/23] Dedup code --- src/document/generator.ml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/document/generator.ml b/src/document/generator.ml index 02679c8886..b0d5795ffd 100644 --- a/src/document/generator.ml +++ b/src/document/generator.ml @@ -1921,15 +1921,18 @@ module Make (Syntax : SYNTAX) = struct let summary = if decl_hidden then O.render (O.keyword "include" ++ O.txt " ...") else - let include_kw, include_decl = + let include_kw = match t.decl with - | Odoc_model.Lang.Include.Alias mod_path -> - (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) + | Odoc_model.Lang.Include.Alias _ | ModuleType _ -> + O.keyword "include" + | Functor _ -> O.keyword "include functor" + in + let include_decl = + match t.decl with + | Odoc_model.Lang.Include.Alias mod_path | Functor (Path mod_path) + -> + Link.from_path (mod_path :> Paths.Path.t) + | Functor (ModuleType mt) | ModuleType mt -> umty mt in O.render (include_kw ++ O.txt " " ++ include_decl From 1550d0506dcecac01c1ec1e43bc28819bc8729d1 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Fri, 10 Jul 2026 10:37:28 +0200 Subject: [PATCH 09/23] Add `@inline` test case --- test/generators/cases/oxcaml.mli | 10 ++- ..._inline-module-type-Make-argument-1-_.html | 32 +++++++++ ...clude_functor_inline-module-type-Make.html | 56 +++++++++++++++ .../html/Oxcaml-Include_functor_inline.html | 59 ++++++++++++++++ ...e_functor_named_type-module-type-Make.html | 2 +- .../Oxcaml-Include_functor_named_type.html | 2 +- test/generators/html/Oxcaml.html | 14 ++++ test/generators/html/oxcaml.targets | 3 + test/generators/latex/Oxcaml.tex | 15 +++- test/generators/link.dune.inc | 69 ++++++++++++++++++- test/generators/man/Oxcaml.3o | 2 + .../man/Oxcaml.Include_functor_inline.3o | 45 ++++++++++++ .../man/Oxcaml.Include_functor_named_type.3o | 2 +- test/generators/man/oxcaml.targets | 1 + ...or_inline-module-type-Make-argument-1-_.md | 6 ++ ...Include_functor_inline-module-type-Make.md | 17 +++++ .../markdown/Oxcaml-Include_functor_inline.md | 14 ++++ ...ude_functor_named_type-module-type-Make.md | 2 +- .../Oxcaml-Include_functor_named_type.md | 2 +- test/generators/markdown/Oxcaml.md | 3 + test/generators/markdown/oxcaml.targets | 3 + 21 files changed, 349 insertions(+), 10 deletions(-) create mode 100644 test/generators/html/Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html create mode 100644 test/generators/html/Oxcaml-Include_functor_inline-module-type-Make.html create mode 100644 test/generators/html/Oxcaml-Include_functor_inline.html create mode 100644 test/generators/man/Oxcaml.Include_functor_inline.3o create mode 100644 test/generators/markdown/Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_inline-module-type-Make.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_inline.md diff --git a/test/generators/cases/oxcaml.mli b/test/generators/cases/oxcaml.mli index 0ee36a673f..677a7e9181 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -540,8 +540,16 @@ module Include_functor : sig end module Include_functor_named_type : sig -(** This is a Module where the type is named and then included. *) +(** This is a module where the functor is named and then included. *) module type Make = (_ : sig type t end) -> sig type included end type t include functor Make end + +module Include_functor_inline : sig +(** This is a test case where the functor is named and included inline *) + module type Make = (_ : sig type t end) -> sig type included end + type t + include functor Make + (** @inline *) +end diff --git a/test/generators/html/Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html b/test/generators/html/Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html new file mode 100644 index 0000000000..1887553dcf --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html @@ -0,0 +1,32 @@ + + + _ (Oxcaml.Include_functor_inline.Make._) + + + + + + + + +
    +

    Parameter Make._

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

    Module type Include_functor_inline.Make

    +

    This is a test case where the functor is named and included inline

    +
    +
    + +
    +
    +

    Parameters +

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

    Signature

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

    Module Oxcaml.Include_functor_inline

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

    This is a test case where the functor is named and included inline +

    +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + type included +
    +
    +
    + + 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 index 4e0c82a4b9..1e66cc3f06 100644 --- 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 @@ -18,7 +18,7 @@

    Module type Include_functor_named_type.Make -

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

    +

    This is a module where the functor is named and then included.

    -

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

    +

    This is a module where the functor is named and then included.

    diff --git a/test/generators/html/Oxcaml.html b/test/generators/html/Oxcaml.html index 83e5e966e5..54ebc1d1eb 100644 --- a/test/generators/html/Oxcaml.html +++ b/test/generators/html/Oxcaml.html @@ -2303,6 +2303,20 @@

    +
    +
    + + + module + Include_functor_inline + + + : sig ... + end + + +
    +
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index 52678d074f..036d6e052e 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -18,3 +18,6 @@ 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 +Oxcaml-Include_functor_inline.html +Oxcaml-Include_functor_inline-module-type-Make.html +Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 97f4a426fd..a50f71f53d 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -417,12 +417,25 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \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}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor 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}}\\ +\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_4}}% +\label{Oxcaml-Include_functor_inline-module-type-Make--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-module-type-Make-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\subsubsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_4}}% +\label{Oxcaml-Include_functor_inline-module-type-Make--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a test case where the functor is named and included inline\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_inline--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_inline--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ \input{Oxcaml.F_with.tex} \input{Oxcaml.X_with.tex} diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index 7672cc95e1..db2aa26fba 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11966,7 +11966,10 @@ 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) + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html.gen + Oxcaml-Include_functor_inline.html.gen + Oxcaml-Include_functor_inline-module-type-Make.html.gen + Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html.gen) (package odoc) (action (run @@ -12117,6 +12120,30 @@ (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})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_inline.html + Oxcaml-Include_functor_inline.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_inline-module-type-Make.html + Oxcaml-Include_functor_inline-module-type-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html + Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12206,7 +12233,8 @@ 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) + Oxcaml.Include_functor_named_type.3o.gen + Oxcaml.Include_functor_inline.3o.gen) (package odoc) (action (run odoc man-generate -o . --extra-suffix gen %{dep:../oxcaml.odocl})) @@ -12292,6 +12320,14 @@ (diff Oxcaml.Include_functor_named_type.3o Oxcaml.Include_functor_named_type.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_inline.3o + Oxcaml.Include_functor_inline.3o.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12334,7 +12370,10 @@ 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) + Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md.gen + Oxcaml-Include_functor_inline.md.gen + Oxcaml-Include_functor_inline-module-type-Make.md.gen + Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md.gen) (package odoc) (action (run @@ -12477,6 +12516,30 @@ (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})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_inline.md + Oxcaml-Include_functor_inline.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_inline-module-type-Make.md + Oxcaml-Include_functor_inline-module-type-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md + Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md.gen)) (enabled_if %{ocaml-config:ox}))) (subdir diff --git a/test/generators/man/Oxcaml.3o b/test/generators/man/Oxcaml.3o index 89d88d63af..df628bf4cf 100644 --- a/test/generators/man/Oxcaml.3o +++ b/test/generators/man/Oxcaml.3o @@ -1207,3 +1207,5 @@ fn_both : int @ local \f[CB]\->\fR int @ local; \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 +.sp +\f[CB]module\fR Include_functor_inline : \f[CB]sig\fR \.\.\. \f[CB]end\fR diff --git a/test/generators/man/Oxcaml.Include_functor_inline.3o b/test/generators/man/Oxcaml.Include_functor_inline.3o new file mode 100644 index 0000000000..77c2a550f6 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_inline.3o @@ -0,0 +1,45 @@ + +.TH Include_functor_inline 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_inline +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml\.Include_functor_inline\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 test case where the functor is named and included inline +.nf +.sp +\f[CB]type\fR t +.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 index f8ef1c2b17..4290e37bce 100644 --- a/test/generators/man/Oxcaml.Include_functor_named_type.3o +++ b/test/generators/man/Oxcaml.Include_functor_named_type.3o @@ -37,7 +37,7 @@ Oxcaml\.Include_functor_named_type .fi .br .ti +2 -This is a Module where the type is named and then included\. +This is a module where the functor is named and then included\. .nf .sp \f[CB]type\fR t diff --git a/test/generators/man/oxcaml.targets b/test/generators/man/oxcaml.targets index 9b7fc4c496..ff4200309e 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -11,3 +11,4 @@ Oxcaml.No_include_functor.T.3o Oxcaml.Include_functor.3o Oxcaml.Include_functor.Make.3o Oxcaml.Include_functor_named_type.3o +Oxcaml.Include_functor_inline.3o diff --git a/test/generators/markdown/Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md b/test/generators/markdown/Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md new file mode 100644 index 0000000000..4f3631ee75 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_inline-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_inline-module-type-Make.md b/test/generators/markdown/Oxcaml-Include_functor_inline-module-type-Make.md new file mode 100644 index 0000000000..ef28e54686 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_inline-module-type-Make.md @@ -0,0 +1,17 @@ + +# Module type `Include_functor_inline.Make` + +This is a test case where the functor is named and included inline + + +## Parameters + +```ocaml +module _ : sig ... end +``` + +## Signature + +```ocaml +type included +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_inline.md b/test/generators/markdown/Oxcaml-Include_functor_inline.md new file mode 100644 index 0000000000..e431dfcf62 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_inline.md @@ -0,0 +1,14 @@ + +# Module `Oxcaml.Include_functor_inline` + +```ocaml +module type Make = functor (_ : sig ... end) -> sig ... end +``` +This is a test case where the functor is named and included inline + +```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.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-Make.md index 2538468067..ef6f25bc4f 100644 --- 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 @@ -1,7 +1,7 @@ # Module type `Include_functor_named_type.Make` -This is a Module where the type is named and then included. +This is a module where the functor is named and then included. ## Parameters diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type.md b/test/generators/markdown/Oxcaml-Include_functor_named_type.md index 7aa04d1ac8..ec3a83e63e 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type.md +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type.md @@ -4,7 +4,7 @@ ```ocaml module type Make = functor (_ : sig ... end) -> sig ... end ``` -This is a Module where the type is named and then included. +This is a module where the functor is named and then included. ```ocaml type t diff --git a/test/generators/markdown/Oxcaml.md b/test/generators/markdown/Oxcaml.md index b52c1bc808..eb70b19aa5 100644 --- a/test/generators/markdown/Oxcaml.md +++ b/test/generators/markdown/Oxcaml.md @@ -706,4 +706,7 @@ module Include_functor : sig ... end ``` ```ocaml module Include_functor_named_type : sig ... end +``` +```ocaml +module Include_functor_inline : sig ... end ``` \ No newline at end of file diff --git a/test/generators/markdown/oxcaml.targets b/test/generators/markdown/oxcaml.targets index 65fbe6ca84..b57e16ea4a 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -18,3 +18,6 @@ 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 +Oxcaml-Include_functor_inline.md +Oxcaml-Include_functor_inline-module-type-Make.md +Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md From 7d95e16947c2e26febc0cc08d95eaab0f3bbf437 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Fri, 10 Jul 2026 10:41:48 +0200 Subject: [PATCH 10/23] Implement with resolving --- src/document/generator.ml | 13 +- src/loader/cmi.ml | 62 + src/loader/cmi.mli | 6 + src/loader/cmt.ml | 40 +- src/loader/cmti.ml | 55 +- src/model/lang.ml | 10 +- src/model_desc/lang_desc.ml | 18 +- src/xref2/compile.ml | 31 +- src/xref2/component.ml | 13 +- src/xref2/component.mli | 3 +- src/xref2/lang_of.ml | 7 +- src/xref2/link.ml | 15 +- src/xref2/subst.ml | 3 +- src/xref2/tools.ml | 35 +- src/xref2/tools.mli | 3 - test/generators/cases/oxcaml.mli | 44 +- test/generators/cases/oxcaml_impl.ml | 33 +- .../Oxcaml-Anonymous_functor-APPLIED_35.html | 35 + .../Oxcaml-Anonymous_functor-BODY_31.html | 48 + ... Oxcaml-Anonymous_functor-INCLUDE_34.html} | 18 +- ...ymous_functor-include10_-argument-1-T.html | 31 + .../html/Oxcaml-Anonymous_functor.html | 106 ++ .../Oxcaml-Anonymous_functor_desugared.html | 46 + .../Oxcaml-Include_functor-APPLIED_12.html | 34 + .../html/Oxcaml-Include_functor-BODY_8.html | 59 + ...clude_functor-INCLUDE_11-argument-1-T.html | 30 + .../Oxcaml-Include_functor-INCLUDE_11.html | 51 + .../html/Oxcaml-Include_functor.html | 54 +- ...e_functor_desugared-Make-argument-1-T.html | 32 + ...Oxcaml-Include_functor_desugared-Make.html | 54 + .../Oxcaml-Include_functor_desugared.html | 67 + ...aml-Include_functor_inline-APPLIED_30.html | 36 + ...Oxcaml-Include_functor_inline-BODY_26.html | 65 + ...unctor_inline-INCLUDE_29-argument-1-_.html | 32 + ...aml-Include_functor_inline-INCLUDE_29.html | 54 + .../html/Oxcaml-Include_functor_inline.html | 69 +- ...Include_functor_named_type-APPLIED_25.html | 40 + ...ml-Include_functor_named_type-BODY_21.html | 71 + ...r_named_type-INCLUDE_24-argument-1-_.html} | 8 +- ...Include_functor_named_type-INCLUDE_24.html | 59 + ...ype-module-type-MakeType-argument-1-_.html | 34 + ...ctor_named_type-module-type-MakeType.html} | 9 +- .../Oxcaml-Include_functor_named_type.html | 70 +- ...red-module-type-MakeType-argument-1-_.html | 38 + ...d_type_desugared-module-type-MakeType.html | 60 + ...-Include_functor_named_type_desugared.html | 77 ++ test/generators/html/Oxcaml.html | 60 + .../Oxcaml_impl-Include_functor-BODY_4.html | 50 + .../Oxcaml_impl-Include_functor-Make.html | 3 +- .../html/Oxcaml_impl-Include_functor.html | 23 +- ..._functor_desugared-Make-argument-1-T.html} | 10 +- ...l_impl-Include_functor_desugared-Make.html | 57 + ...Oxcaml_impl-Include_functor_desugared.html | 74 ++ .../html/Oxcaml_impl-No_include_functor.html | 104 -- ..._impl-Resolve_functor-F-argument-1-I.html} | 10 +- .../html/Oxcaml_impl-Resolve_functor-F.html | 56 + ...Oxcaml_impl-Resolve_functor-M-BODY_14.html | 31 + .../html/Oxcaml_impl-Resolve_functor-M.html | 67 + .../html/Oxcaml_impl-Resolve_functor.html | 49 + test/generators/html/Oxcaml_impl.html | 27 +- test/generators/html/Oxcaml_impl.md | 0 test/generators/html/oxcaml.targets | 36 +- test/generators/html/oxcaml_impl.targets | 15 +- test/generators/latex/Oxcaml.M2.tex | 12 - test/generators/latex/Oxcaml.M3.tex | 0 test/generators/latex/Oxcaml.tex | 92 +- test/generators/latex/Oxcaml_impl.md | 0 test/generators/latex/Oxcaml_impl.tex | 26 +- test/generators/link.dune.inc | 1178 +++++++++++++++-- test/generators/man/Oxcaml.3o | 8 + .../man/Oxcaml.Anonymous_functor.3o | 27 + .../Oxcaml.Anonymous_functor.APPLIED_35.3o | 14 + .../man/Oxcaml.Anonymous_functor.BODY_31.3o | 21 + .../Oxcaml.Anonymous_functor.INCLUDE_34.3o | 30 + .../man/Oxcaml.Anonymous_functor_desugared.3o | 16 + test/generators/man/Oxcaml.Include_functor.3o | 8 +- .../man/Oxcaml.Include_functor.APPLIED_12.3o | 14 + .../man/Oxcaml.Include_functor.BODY_8.3o | 23 + .../man/Oxcaml.Include_functor.INCLUDE_11.3o | 30 + .../man/Oxcaml.Include_functor_desugared.3o | 18 + .../Oxcaml.Include_functor_desugared.Make.3o | 30 + .../man/Oxcaml.Include_functor_inline.3o | 8 +- ...xcaml.Include_functor_inline.APPLIED_30.3o | 14 + .../Oxcaml.Include_functor_inline.BODY_26.3o | 45 + ...xcaml.Include_functor_inline.INCLUDE_29.3o | 30 + .../man/Oxcaml.Include_functor_named_type.3o | 10 +- ...l.Include_functor_named_type.APPLIED_25.3o | 14 + ...caml.Include_functor_named_type.BODY_21.3o | 45 + ...l.Include_functor_named_type.INCLUDE_24.3o | 30 + ...ml.Include_functor_named_type_desugared.3o | 45 + test/generators/man/Oxcaml_impl.3o | 6 +- .../man/Oxcaml_impl.Include_functor.3o | 6 +- .../man/Oxcaml_impl.Include_functor.BODY_4.3o | 21 + .../man/Oxcaml_impl.Include_functor.Make.3o | 2 +- .../Oxcaml_impl.Include_functor_desugared.3o | 23 + ...ml_impl.Include_functor_desugared.Make.3o} | 6 +- .../man/Oxcaml_impl.No_include_functor.3o | 25 - .../man/Oxcaml_impl.No_include_functor.T.3o | 14 - .../man/Oxcaml_impl.Resolve_functor.3o | 16 + .../man/Oxcaml_impl.Resolve_functor.F.3o | 30 + .../man/Oxcaml_impl.Resolve_functor.M.3o | 18 + .../Oxcaml_impl.Resolve_functor.M.BODY_14.3o | 14 + test/generators/man/oxcaml.targets | 19 + test/generators/man/oxcaml_impl.targets | 11 +- .../Oxcaml-Anonymous_functor-APPLIED_35.md | 6 + .../Oxcaml-Anonymous_functor-BODY_31.md | 11 + .../Oxcaml-Anonymous_functor-INCLUDE_34.md | 15 + ...onymous_functor-include10_-argument-1-T.md | 6 + .../markdown/Oxcaml-Anonymous_functor.md | 20 + .../Oxcaml-Anonymous_functor_desugared.md | 9 + .../Oxcaml-Include_functor-APPLIED_12.md | 6 + .../markdown/Oxcaml-Include_functor-BODY_8.md | 14 + ...Include_functor-INCLUDE_11-argument-1-T.md | 6 + .../Oxcaml-Include_functor-INCLUDE_11.md | 15 + .../markdown/Oxcaml-Include_functor.md | 11 +- ...de_functor_desugared-Make-argument-1-T.md} | 0 .../Oxcaml-Include_functor_desugared-Make.md | 15 + .../Oxcaml-Include_functor_desugared.md | 12 + ...xcaml-Include_functor_inline-APPLIED_30.md | 6 + .../Oxcaml-Include_functor_inline-BODY_26.md | 14 + ..._functor_inline-INCLUDE_29-argument-1-_.md | 6 + ...xcaml-Include_functor_inline-INCLUDE_29.md | 15 + .../markdown/Oxcaml-Include_functor_inline.md | 11 +- ...l-Include_functor_named_type-APPLIED_25.md | 6 + ...caml-Include_functor_named_type-BODY_21.md | 14 + ...ctor_named_type-INCLUDE_24-argument-1-_.md | 6 + ...l-Include_functor_named_type-INCLUDE_24.md | 15 + ..._type-module-type-MakeType-argument-1-_.md | 6 + ...unctor_named_type-module-type-MakeType.md} | 2 +- .../Oxcaml-Include_functor_named_type.md | 13 +- ...gared-module-type-MakeType-argument-1-_.md | 6 + ...med_type_desugared-module-type-MakeType.md | 17 + ...ml-Include_functor_named_type_desugared.md | 14 + test/generators/markdown/Oxcaml.md | 12 + .../Oxcaml_impl-Include_functor-BODY_4.md | 11 + .../Oxcaml_impl-Include_functor-Make.md | 2 +- .../markdown/Oxcaml_impl-Include_functor.md | 7 +- ...de_functor_desugared-Make-argument-1-T.md} | 2 +- ...aml_impl-Include_functor_desugared-Make.md | 17 + .../Oxcaml_impl-Include_functor_desugared.md | 14 + .../Oxcaml_impl-No_include_functor-Make.md | 17 - .../Oxcaml_impl-No_include_functor-T.md | 6 - .../Oxcaml_impl-No_include_functor.md | 17 - ...aml_impl-Resolve_functor-F-argument-1-I.md | 6 + .../markdown/Oxcaml_impl-Resolve_functor-F.md | 15 + .../Oxcaml_impl-Resolve_functor-M-BODY_14.md | 6 + .../markdown/Oxcaml_impl-Resolve_functor-M.md | 12 + .../markdown/Oxcaml_impl-Resolve_functor.md | 9 + test/generators/markdown/Oxcaml_impl.md | 7 +- test/generators/markdown/oxcaml.targets | 36 +- test/generators/markdown/oxcaml_impl.targets | 15 +- 151 files changed, 4397 insertions(+), 560 deletions(-) create mode 100644 test/generators/html/Oxcaml-Anonymous_functor-APPLIED_35.html create mode 100644 test/generators/html/Oxcaml-Anonymous_functor-BODY_31.html rename test/generators/html/{Oxcaml_impl-No_include_functor-Make.html => Oxcaml-Anonymous_functor-INCLUDE_34.html} (72%) create mode 100644 test/generators/html/Oxcaml-Anonymous_functor-include10_-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Anonymous_functor.html create mode 100644 test/generators/html/Oxcaml-Anonymous_functor_desugared.html create mode 100644 test/generators/html/Oxcaml-Include_functor-APPLIED_12.html create mode 100644 test/generators/html/Oxcaml-Include_functor-BODY_8.html create mode 100644 test/generators/html/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Include_functor-INCLUDE_11.html create mode 100644 test/generators/html/Oxcaml-Include_functor_desugared-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Include_functor_desugared-Make.html create mode 100644 test/generators/html/Oxcaml-Include_functor_desugared.html create mode 100644 test/generators/html/Oxcaml-Include_functor_inline-APPLIED_30.html create mode 100644 test/generators/html/Oxcaml-Include_functor_inline-BODY_26.html create mode 100644 test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html create mode 100644 test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type-APPLIED_25.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type-BODY_21.html rename test/generators/html/{Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.html => Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html} (76%) create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type-INCLUDE_24.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html rename test/generators/html/{Oxcaml-Include_functor_named_type-module-type-Make.html => Oxcaml-Include_functor_named_type-module-type-MakeType.html} (89%) create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type_desugared.html create mode 100644 test/generators/html/Oxcaml_impl-Include_functor-BODY_4.html rename test/generators/html/{Oxcaml_impl-No_include_functor-Make-argument-1-T.html => Oxcaml_impl-Include_functor_desugared-Make-argument-1-T.html} (73%) create mode 100644 test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html create mode 100644 test/generators/html/Oxcaml_impl-Include_functor_desugared.html delete mode 100644 test/generators/html/Oxcaml_impl-No_include_functor.html rename test/generators/html/{Oxcaml_impl-No_include_functor-T.html => Oxcaml_impl-Resolve_functor-F-argument-1-I.html} (70%) create mode 100644 test/generators/html/Oxcaml_impl-Resolve_functor-F.html create mode 100644 test/generators/html/Oxcaml_impl-Resolve_functor-M-BODY_14.html create mode 100644 test/generators/html/Oxcaml_impl-Resolve_functor-M.html create mode 100644 test/generators/html/Oxcaml_impl-Resolve_functor.html delete mode 100644 test/generators/html/Oxcaml_impl.md delete mode 100644 test/generators/latex/Oxcaml.M2.tex delete mode 100644 test/generators/latex/Oxcaml.M3.tex delete mode 100644 test/generators/latex/Oxcaml_impl.md create mode 100644 test/generators/man/Oxcaml.Anonymous_functor.3o create mode 100644 test/generators/man/Oxcaml.Anonymous_functor.APPLIED_35.3o create mode 100644 test/generators/man/Oxcaml.Anonymous_functor.BODY_31.3o create mode 100644 test/generators/man/Oxcaml.Anonymous_functor.INCLUDE_34.3o create mode 100644 test/generators/man/Oxcaml.Anonymous_functor_desugared.3o create mode 100644 test/generators/man/Oxcaml.Include_functor.APPLIED_12.3o create mode 100644 test/generators/man/Oxcaml.Include_functor.BODY_8.3o create mode 100644 test/generators/man/Oxcaml.Include_functor.INCLUDE_11.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_desugared.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_desugared.Make.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_inline.APPLIED_30.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_inline.BODY_26.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_inline.INCLUDE_29.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_named_type.APPLIED_25.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_named_type.BODY_21.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_named_type.INCLUDE_24.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_named_type_desugared.3o create mode 100644 test/generators/man/Oxcaml_impl.Include_functor.BODY_4.3o create mode 100644 test/generators/man/Oxcaml_impl.Include_functor_desugared.3o rename test/generators/man/{Oxcaml_impl.No_include_functor.Make.3o => Oxcaml_impl.Include_functor_desugared.Make.3o} (62%) delete mode 100644 test/generators/man/Oxcaml_impl.No_include_functor.3o delete mode 100644 test/generators/man/Oxcaml_impl.No_include_functor.T.3o create mode 100644 test/generators/man/Oxcaml_impl.Resolve_functor.3o create mode 100644 test/generators/man/Oxcaml_impl.Resolve_functor.F.3o create mode 100644 test/generators/man/Oxcaml_impl.Resolve_functor.M.3o create mode 100644 test/generators/man/Oxcaml_impl.Resolve_functor.M.BODY_14.3o create mode 100644 test/generators/markdown/Oxcaml-Anonymous_functor-APPLIED_35.md create mode 100644 test/generators/markdown/Oxcaml-Anonymous_functor-BODY_31.md create mode 100644 test/generators/markdown/Oxcaml-Anonymous_functor-INCLUDE_34.md create mode 100644 test/generators/markdown/Oxcaml-Anonymous_functor-include10_-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-Anonymous_functor.md create mode 100644 test/generators/markdown/Oxcaml-Anonymous_functor_desugared.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor-APPLIED_12.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor-BODY_8.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11.md rename test/generators/markdown/{Oxcaml_impl-No_include_functor-Make-argument-1-T.md => Oxcaml-Include_functor_desugared-Make-argument-1-T.md} (100%) create mode 100644 test/generators/markdown/Oxcaml-Include_functor_desugared-Make.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_desugared.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_inline-APPLIED_30.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_inline-BODY_26.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-APPLIED_25.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-BODY_21.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md rename test/generators/markdown/{Oxcaml-Include_functor_named_type-module-type-Make.md => Oxcaml-Include_functor_named_type-module-type-MakeType.md} (75%) create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type_desugared.md create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor-BODY_4.md rename test/generators/markdown/{Oxcaml-Include_functor_named_type-module-type-Make-argument-1-_.md => Oxcaml_impl-Include_functor_desugared-Make-argument-1-T.md} (50%) create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor_desugared-Make.md create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor_desugared.md delete mode 100644 test/generators/markdown/Oxcaml_impl-No_include_functor-Make.md delete mode 100644 test/generators/markdown/Oxcaml_impl-No_include_functor-T.md delete mode 100644 test/generators/markdown/Oxcaml_impl-No_include_functor.md create mode 100644 test/generators/markdown/Oxcaml_impl-Resolve_functor-F-argument-1-I.md create mode 100644 test/generators/markdown/Oxcaml_impl-Resolve_functor-F.md create mode 100644 test/generators/markdown/Oxcaml_impl-Resolve_functor-M-BODY_14.md create mode 100644 test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md create mode 100644 test/generators/markdown/Oxcaml_impl-Resolve_functor.md diff --git a/src/document/generator.ml b/src/document/generator.ml index b0d5795ffd..35cbda85ba 100644 --- a/src/document/generator.ml +++ b/src/document/generator.ml @@ -1912,8 +1912,10 @@ module Make (Syntax : SYNTAX) = struct and include_ (t : Odoc_model.Lang.Include.t) = let decl_hidden = match t.decl with - | Alias p | Functor (Path p) -> Paths.Path.(is_hidden (p :> t)) - | ModuleType mty | Functor (ModuleType mty) -> umty_hidden mty + | Alias p | Functor { original_ref = Path p; _ } -> + Paths.Path.(is_hidden (p :> t)) + | Functor { original_ref = ModuleType mty; _ } -> mty_hidden mty + | ModuleType umty -> umty_hidden umty in let status = if decl_hidden then `Inline else t.status in @@ -1929,10 +1931,11 @@ module Make (Syntax : SYNTAX) = struct in let include_decl = match t.decl with - | Odoc_model.Lang.Include.Alias mod_path | Functor (Path mod_path) - -> + | Odoc_model.Lang.Include.Alias mod_path + | Functor { original_ref = Path mod_path; _ } -> Link.from_path (mod_path :> Paths.Path.t) - | Functor (ModuleType mt) | ModuleType mt -> umty mt + | Functor { original_ref = ModuleType mt; _ } -> mty mt + | ModuleType mt -> umty mt in O.render (include_kw ++ O.txt " " ++ include_decl diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index 5a91f648c4..3da9ef57d9 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -1638,3 +1638,65 @@ let read_interface root name ~warnings_tag intf = id intf in (id, items) + +let generate_wrapper_module = + let wrapper_counter = ref 0 in + fun parent ~prefix ~hidden -> + incr wrapper_counter; + let dummy_id = + let dummy_name = + let sep = match hidden with | true -> "__" | false -> "_" in + let name = Printf.sprintf "%s%s%d" prefix sep !wrapper_counter in + match hidden with + | false -> Odoc_model.Names.ModuleName.make_std name + | true -> Odoc_model.Names.ModuleName.hidden_of_string name + in + Identifier.Mk.module_ (parent, dummy_name) + in + let dummy_path = `Identifier (dummy_id, hidden) in + (dummy_id, dummy_path) + +let shadow_nothing : Include.shadowed = + {s_modules=[]; s_module_types=[]; s_values=[]; s_types=[]; s_classes=[]; s_class_types=[]} + +let no_doc : Odoc_model.Comment.docs = { elements = []; warnings_tag = None } +let no_loc = Odoc_model.Location_.span [] + +let wrapper_and_include parent (dummy_id, dummy_path) ~hidden items = + let doc = no_doc in + let sig_ : Signature.t = {items; compiled=true; removed=[]; doc} in + let type_ : Module.decl = ModuleType (Signature sig_) in + let module_ : Module.t = {id=dummy_id; source_loc=None; doc; type_; canonical=None; hidden} in + let dummy_module : Signature.item = Module (Ordinary, module_) in + let umt : ModuleType.U.expr = TypeOf (StructInclude dummy_path, dummy_path) in + let decl : Include.decl = ModuleType umt in + let expansion : Include.expansion = {shadowed=shadow_nothing; content=sig_} in + let include_ : Include.t = {loc=no_loc; parent; strengthened=None; doc; status=`Inline; decl; expansion} in + let include_dummy : Signature.item = Include include_ in + (dummy_module, include_dummy) + +let generate_wrapper_module_sig parent ~include_functors wrapper ~hidden items = + let dummy_module, include_dummy = wrapper_and_include parent wrapper ~hidden items in + let include_functors = List.rev_map (fun include_ -> Signature.Include include_) include_functors in + [dummy_module; include_dummy] @ include_functors + +let generate_wrapper_module_functor_type parent ~include_functors (dummy_id, dummy_path) ~hidden items = + let dummy_module, include_dummy = wrapper_and_include parent (dummy_id, dummy_path) ~hidden items in + (* functor type applied modules *) + let modules_and_applications = List.map (fun include_functor -> + match include_functor with + | {Include.decl = Include.Functor ({target=ModuleType mty; _} as f)} -> ( + let (id, path) = generate_wrapper_module parent ~prefix:"APPLIED" ~hidden in + let type_ = Module.ModuleType mty in + let functor_module : Module.t = {id; source_loc=None; doc=no_doc; type_; canonical=None; hidden} in + let module_ = Signature.Module (Ordinary, functor_module) in + let expansion = include_functor.Include.expansion in + let decl = Include.Functor {f with target = Path path} in + let application = Signature.Include {decl; parent; doc=no_doc; strengthened=None; loc=no_loc;expansion;status=`Default} in + [module_; application] + ) + | _ -> failwith "unexpected include which is not an include functor") include_functors + |> List.concat + in + [dummy_module; include_dummy] @ modules_and_applications + diff --git a/src/loader/cmi.mli b/src/loader/cmi.mli index a19f595fc1..5af4928b32 100644 --- a/src/loader/cmi.mli +++ b/src/loader/cmi.mli @@ -128,3 +128,9 @@ val read_value_descr_modalities : val read_label_modalities : Types.label_declaration -> Odoc_model.Lang.Modalities.t + +val generate_wrapper_module : Paths.Identifier.Signature.t -> prefix:string -> hidden:bool -> Paths.Identifier.Module.t * Paths.Path.Module.t + +val generate_wrapper_module_sig : Paths.Identifier.Signature.t -> include_functors:Odoc_model.Lang.Include.t list -> (Paths.Identifier.Module.t * Paths.Path.Module.t) -> hidden:bool -> Odoc_model.Lang.Signature.item list -> Odoc_model.Lang.Signature.item list + +val generate_wrapper_module_functor_type : Paths.Identifier.Signature.t -> include_functors:Odoc_model.Lang.Include.t list -> (Paths.Identifier.Module.t * Paths.Path.Module.t) -> hidden:bool -> Odoc_model.Lang.Signature.item list -> Odoc_model.Lang.Signature.item list diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index a2bf3453ac..de67ce02c9 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -22,6 +22,7 @@ module OCamlPath = Path open Odoc_model.Paths open Odoc_model.Lang +module Names = Odoc_model.Names module Env = Ident_env @@ -522,7 +523,7 @@ and read_module_bindings env parent mbs = |> fst |> List.rev -and read_structure_item env parent item = +and read_structure_item env parent include_functor_wrapper item = let open Signature in match item.str_desc with | Tstr_eval _ -> [] @@ -557,7 +558,7 @@ and read_structure_item env parent item = | Tstr_open o -> [Open (read_open env parent o)] | Tstr_include incl -> - read_include env parent incl + read_include env parent include_functor_wrapper incl | Tstr_class cls -> let cls = List.map (fun (cl, _) -> cl) cls in read_class_declarations env parent cls @@ -573,7 +574,7 @@ and read_structure_item env parent item = | None -> [] | Some doc -> [Comment doc] -and read_include env parent incl = +and read_include env parent include_functor_wrapper incl = let open Include in let loc = Doc_attr.read_location incl.incl_loc in let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in @@ -582,8 +583,9 @@ and read_include env parent incl = #if defined OXCAML match unwrap_module_expr_desc incl.incl_mod.mod_desc, incl.incl_kind with | Tmod_ident (p, _), (Tincl_functor _ | Tincl_gen_functor _) -> ( - let p = Env.Path.read_module env.ident_env p in - Some (`Functor p)) + let include_functor = Env.Path.read_module env.ident_env p in + let target = `Apply (include_functor, include_functor_wrapper) in + Some (`Functor (target, include_functor))) | Tmod_ident(p, _), Tincl_structure -> #else match unwrap_module_expr_desc incl.incl_mod.mod_desc with @@ -601,8 +603,8 @@ and read_include env parent incl = | 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 + | Some `Functor (target, original_ref) -> + let decl = Include.Functor {target = Path target; original_ref=Path original_ref} in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] | _ -> content.items @@ -629,12 +631,26 @@ and read_structure : in Doc_attr.extract_top_comment internal_tags ~warnings_tag:env.warnings_tag ~classify parent str.str_items in - let items = + let hidden = false in + let dummy_id, dummy_path = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in + let items, include_functors = List.fold_left - (fun items item -> - List.rev_append (read_structure_item env parent item) items) - [] items - |> List.rev + (fun (items, include_functors) item -> + let structure_items, include_functors = + read_structure_item env parent dummy_path item + |> List.partition_map (function + | Signature.Include ({ decl = Include.Functor _ } as include_functor) -> Right include_functor + | otherwise -> Left otherwise) + in + (List.rev_append structure_items items, include_functors)) + ([], []) items + in + let items = List.rev items in + let items = match include_functors with + | [] -> items + | include_functors -> + (* if we have any include functors, we need to wrap *) + Cmi.generate_wrapper_module_sig parent ~include_functors (dummy_id, dummy_path) ~hidden items in match doc_post with | { elements = [] ; _} -> diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index eb9680112b..0c5dd7259c 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -813,7 +813,7 @@ and read_module_equation env p = let open Module in Alias (Env.Path.read_module env.ident_env p, None) -and read_signature_item env parent item = +and read_signature_item env parent include_functor_wrapper item = let open Signature in match item.sig_desc with | Tsig_value vd -> @@ -847,7 +847,7 @@ and read_signature_item env parent item = #else | Tsig_include incl -> #endif - read_include env parent incl + read_include env parent include_functor_wrapper incl | Tsig_class cls -> read_class_descriptions env parent cls | Tsig_class_type cltyps -> @@ -894,7 +894,7 @@ and read_module_type_substitution env parent mtd = -and read_include env parent incl = +and read_include env parent include_functor_wrapper incl = let open Include in let loc = Doc_attr.read_location incl.incl_loc in let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in @@ -910,8 +910,8 @@ and read_include env parent incl = let umty = Odoc_model.Lang.umty_of_mty expr in let expansion = { content; shadowed; } in #if defined OXCAML - match umty, incl.incl_kind with - | Some uexpr, Tincl_structure -> + match umty, incl.incl_mod.mty_desc, incl.incl_kind with + | Some uexpr, _, Tincl_structure -> #else match umty with | Some uexpr -> @@ -919,13 +919,20 @@ and read_include env parent incl = 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 }] + | _, Tmty_typeof _, (Tincl_functor _ | Tincl_gen_functor _) + | _, Tmty_ident (_, _), (Tincl_functor _ | Tincl_gen_functor _) -> ( + let hidden = false in + let type_ : Module.decl = ModuleType expr in + let id, functor_path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in + let functor_ : Module.t = {id; source_loc=None; doc; type_; canonical=None; hidden} in + let functor_ = Signature.Module (Ordinary, functor_) in + let module_path : Path.Module.t = `Apply (functor_path, include_functor_wrapper) in + + (* include that module *) + let mt : ModuleType.expr = ModuleType.TypeOf {t_desc = StructInclude module_path; t_original_path = module_path; t_expansion = None } in + let decl = Functor {target=ModuleType mt; original_ref=ModuleType expr} in + let include_ = Signature.Include {parent; doc; decl; expansion; status; strengthened=None; loc } in + [functor_; include_]) #endif | _ -> content.items @@ -952,12 +959,26 @@ and read_signature : in Doc_attr.extract_top_comment internal_tags ~warnings_tag:env.warnings_tag ~classify parent sg.sig_items in - let items = + let hidden = false in + let dummy_id, dummy_path = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in + let items, include_functors = List.fold_left - (fun items item -> - List.rev_append (read_signature_item env parent item) items) - [] items - |> List.rev + (fun (items, include_functors) item -> + let signature_items, include_functors = + read_signature_item env parent dummy_path item + |> List.partition_map (function + | Signature.Include ({ decl = Include.Functor _ } as include_functor) -> Right include_functor + | otherwise -> Left otherwise) + in + (List.rev_append signature_items items, include_functors)) + ([], []) items + in + let items = List.rev items in + let items = match include_functors with + | [] -> items + | include_functors -> + (* if we have any include functor, we need to wrap *) + Cmi.generate_wrapper_module_functor_type parent ~include_functors (dummy_id, dummy_path) ~hidden items in match doc_post with | {elements=[]; _} -> diff --git a/src/model/lang.ml b/src/model/lang.ml index eff11be1cf..729e65eb7b 100644 --- a/src/model/lang.ml +++ b/src/model/lang.ml @@ -195,13 +195,15 @@ and Include : sig type expansion = { shadowed : shadowed; content : Signature.t } - type functor' = Path of Path.Module.t | ModuleType of ModuleType.U.expr + type functor_ref = Path of Path.Module.t | ModuleType of ModuleType.expr + + type functor_t = { target : functor_ref; original_ref : functor_ref } (* Explicitly unexpanded decl *) type decl = | Alias of Path.Module.t | ModuleType of ModuleType.U.expr - | Functor of functor' + | Functor of functor_t type t = { loc : Location_.span; @@ -644,9 +646,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; _ } | { decl = Functor (Path p); _ } -> + | { decl = Functor { original_ref = Path p }; _ } | { decl = Alias p; _ } -> Paths.Path.is_hidden (p :> Path.t) - | { decl = Functor (ModuleType expr); _ } -> uexpr_considered_hidden expr + | { decl = Functor { original_ref = ModuleType _ }; _ } -> assert false | { 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 065e5e42d0..9f71f2b794 100644 --- a/src/model_desc/lang_desc.ml +++ b/src/model_desc/lang_desc.ml @@ -288,13 +288,27 @@ and include_shadowed = F ("s_class_types", (fun t -> List.map fst t.s_class_types), List string); ] +and include_functor_ref = + let open Lang.Include in + Variant + (function + | Path p -> C ("Path", (p :> Paths.Path.t), path) + | ModuleType e -> C ("ModuleType", e, moduletype_expr)) + +and include_functor_t = + let open Lang.Include in + Record + [ + F ("target", (fun t -> t.target), include_functor_ref); + F ("original_ref", (fun t -> t.original_ref), include_functor_ref); + ] + and include_decl = let open Lang.Include in 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) + | Functor f -> C ("Functor", f, include_functor_t) | ModuleType e -> C ("ModuleType", e, moduletype_u_expr)) and include_expansion = diff --git a/src/xref2/compile.ml b/src/xref2/compile.ml index 92af14fda2..7b8d961115 100644 --- a/src/xref2/compile.ml +++ b/src/xref2/compile.ml @@ -389,10 +389,19 @@ 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)) + | Functor { target = Path target; original_ref = Path original_ref } -> + Functor + { + target = Path (module_path env target); + original_ref = Path (module_path env original_ref); + } + | Functor { target = Path p; original_ref = ModuleType mt } -> + Functor + { + target = Path (module_path env p); + original_ref = ModuleType (module_type_expr env id mt); + } + | Functor { target = ModuleType _ } -> assert false | Alias p -> Alias (module_path env p) and module_type : Env.t -> ModuleType.t -> ModuleType.t = @@ -414,16 +423,10 @@ 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 -> + | Alias p | Functor 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 ~allow_functor:false + | ModuleType mty -> Tools.signature_of_u_module_type_expr env mty with | Error e -> Errors.report ~what:(`Include decl) ~tools_error:e `Expand; @@ -649,9 +652,7 @@ 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 ~allow_functor:false - with + match Tools.signature_of_u_module_type_expr env cexpr 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 1bceeefcf9..ee645dd023 100644 --- a/src/xref2/component.ml +++ b/src/xref2/component.ml @@ -367,11 +367,10 @@ end = Open and Include : sig - 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' + | Functor of Cpath.module_ type t = { parent : Odoc_model.Paths.Identifier.Signature.t; @@ -931,9 +930,7 @@ 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 + | Functor p -> Format.fprintf ppf "functor %a" (module_path c) p | ModuleType mt -> Format.fprintf ppf "%a" (u_module_type_expr c) mt and value c ppf v = @@ -2423,9 +2420,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)) + | Functor { target = Path p; _ } -> + Include.Functor (module_path ident_map p) + | Functor { target = ModuleType _ } -> assert false | 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 2ebf3f342f..f8395d9e81 100644 --- a/src/xref2/component.mli +++ b/src/xref2/component.mli @@ -339,11 +339,10 @@ and Open : sig end and Include : sig - 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' + | Functor of Cpath.module_ type t = { parent : Odoc_model.Paths.Identifier.Signature.t; diff --git a/src/xref2/lang_of.ml b/src/xref2/lang_of.ml index 4f62f10a49..8f0e92e60a 100644 --- a/src/xref2/lang_of.ml +++ b/src/xref2/lang_of.ml @@ -651,10 +651,9 @@ 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)) + | Functor p -> + let target = Lang.Include.Path (Path.module_ map p) in + Functor { target; original_ref = target } | 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 3cd4d2d5a5..a76d4a01d4 100644 --- a/src/xref2/link.ml +++ b/src/xref2/link.ml @@ -707,9 +707,10 @@ 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)) + | Functor ({ target = Path p; _ } as f) -> + let target = Path (module_path env p) in + Functor { f with target } + | Functor mt -> Functor mt | Alias p -> Alias (module_path env p) and module_type : Env.t -> ModuleType.t -> ModuleType.t = @@ -901,9 +902,7 @@ 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 ~allow_functor:false - with + match Tools.signature_of_u_module_type_expr env cexpr with | Ok sg -> With (handle_fragments env id sg subs, u_module_type_expr env id expr) | Error e -> @@ -950,9 +949,7 @@ 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 ~allow_functor:false - with + match Tools.signature_of_u_module_type_expr env cexpr with | Ok sg -> With { diff --git a/src/xref2/subst.ml b/src/xref2/subst.ml index bfb5706310..2358c36ac0 100644 --- a/src/xref2/subst.ml +++ b/src/xref2/subst.ml @@ -760,8 +760,7 @@ 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) + | Functor p -> Functor (module_path s p) | 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 7716d50e7c..2c1b9d5f2f 100644 --- a/src/xref2/tools.ml +++ b/src/xref2/tools.ml @@ -1577,12 +1577,6 @@ 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 @@ -1618,28 +1612,22 @@ 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 ~allow_functor -> + fun env m -> match m with | Component.ModuleType.U.Path p -> ( match resolve_module_type env p with - | Ok (_, mt) -> ( - expansion_of_module_type env mt - >>= - match allow_functor with - | true -> assert_functor - | false -> assert_not_functor) + | Ok (_, mt) -> expansion_of_module_type env mt >>= 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 ~allow_functor >>= fun sg -> + signature_of_u_module_type_expr env s >>= 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 ~allow_functor >>= fun sg -> + signature_of_u_module_type_expr env expr >>= fun sg -> Ok (Strengthen.signature path sg) and expansion_of_simple_expansion : @@ -1670,8 +1658,7 @@ 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 ~allow_functor:false - >>= fun sg -> + signature_of_u_module_type_expr env w_expr >>= 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)) @@ -1685,8 +1672,7 @@ 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 ~allow_functor:false - >>= fun sg -> + signature_of_u_module_type_expr env s_expr >>= fun sg -> let sg = Strengthen.signature s_path sg in Ok (Signature sg) @@ -1813,16 +1799,11 @@ and fragmap : let map_include_decl decl subst = let open Component.Include in match decl with - | Alias p -> + | Alias p | Functor p -> expansion_of_module_path env ~strengthen:true p >>= assert_not_functor >>= fun sg -> fragmap env subst sg >>= fun sg -> Ok (ModuleType (Signature sg)) - | 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'))) + | 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 b381c1534e..81c1322c42 100644 --- a/src/xref2/tools.mli +++ b/src/xref2/tools.mli @@ -201,8 +201,6 @@ 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 -> @@ -242,7 +240,6 @@ 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 677a7e9181..de2973ae6c 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -539,11 +539,34 @@ module Include_functor : sig include functor module type of Make end +module Include_functor_desugared : sig + module Make (T : sig type t end) : sig type included end + + module DUMMY__ : sig + type t + end + include module type of DUMMY__ + + include module type of Make(DUMMY__) +end + +module Include_functor_named_type_desugared : sig +(** This is a module where the functor is named and then included. *) + module type MakeType = (_ : sig type t end) -> sig type included end + module DUMMY__ : sig + type t + end + include module type of DUMMY__ + + module STRUCT__MakeType : MakeType + include module type of STRUCT__MakeType(DUMMY__) +end + module Include_functor_named_type : sig (** This is a module where the functor is named and then included. *) - module type Make = (_ : sig type t end) -> sig type included end + module type MakeType = (_ : sig type t end) -> sig type included end type t - include functor Make + include functor MakeType end module Include_functor_inline : sig @@ -553,3 +576,20 @@ module Include_functor_inline : sig include functor Make (** @inline *) end + +module Anonymous_functor : sig +(** In this test case the functor is defined inline *) + type t + include functor module type of functor (T : sig type t end) -> struct type included end +end + +module Anonymous_functor_desugared : sig +(** In this test case the functor is defined inline *) + module DUMMY__ : sig + type t + end + include module type of DUMMY__ + + include module type of (functor (T : sig type t end) -> struct type included end)(DUMMY__) +end + diff --git a/test/generators/cases/oxcaml_impl.ml b/test/generators/cases/oxcaml_impl.ml index 39366b13b4..9ddce9f1cc 100644 --- a/test/generators/cases/oxcaml_impl.ml +++ b/test/generators/cases/oxcaml_impl.ml @@ -62,21 +62,30 @@ let mode_multi : string @ local once -> string @ local once = fun x -> x (** {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 Include_functor = struct +(** This module demonstrates the [include functor] functionality *) module Make (T : sig type t end) = struct type included end - module T = struct + type t + include functor Make +end + +module Include_functor_desugared = struct +(** This module is the desugared version from above *) + module Make (T : sig type t end) = struct type included end + module DUMMY__ = struct type t end - - include T - include Make(T) + include DUMMY__ + include Make(DUMMY__) 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 +module Resolve_functor = struct + module F ( I : sig type t end ) = struct + type myt = I.t + end + + module M = struct + type t = float + include functor F + end end diff --git a/test/generators/html/Oxcaml-Anonymous_functor-APPLIED_35.html b/test/generators/html/Oxcaml-Anonymous_functor-APPLIED_35.html new file mode 100644 index 0000000000..27deaa5970 --- /dev/null +++ b/test/generators/html/Oxcaml-Anonymous_functor-APPLIED_35.html @@ -0,0 +1,35 @@ + + + APPLIED_35 (Oxcaml.Anonymous_functor.APPLIED_35) + + + + + + + + +
    +

    Module Anonymous_functor.APPLIED_35

    +
    +
    +
    +
    + + type included + = + + INCLUDE_34(BODY_31).included + + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Anonymous_functor-BODY_31.html b/test/generators/html/Oxcaml-Anonymous_functor-BODY_31.html new file mode 100644 index 0000000000..a01d4c994a --- /dev/null +++ b/test/generators/html/Oxcaml-Anonymous_functor-BODY_31.html @@ -0,0 +1,48 @@ + + + BODY_31 (Oxcaml.Anonymous_functor.BODY_31) + + + + + + + + +
    +

    Module Anonymous_functor.BODY_31

    +
    +
    +
    +
    + + type t +
    +
    +

    In this test case the functor is defined inline

    +
    +
    +
    +
    + + + module + INCLUDE_34 + + ( + T + : sig ... + end) : sig + ... end + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-No_include_functor-Make.html b/test/generators/html/Oxcaml-Anonymous_functor-INCLUDE_34.html similarity index 72% rename from test/generators/html/Oxcaml_impl-No_include_functor-Make.html rename to test/generators/html/Oxcaml-Anonymous_functor-INCLUDE_34.html index 69ea651872..a510568b4b 100644 --- a/test/generators/html/Oxcaml_impl-No_include_functor-Make.html +++ b/test/generators/html/Oxcaml-Anonymous_functor-INCLUDE_34.html @@ -1,6 +1,6 @@ - Make (Oxcaml_impl.No_include_functor.Make) + INCLUDE_34 (Oxcaml.Anonymous_functor.INCLUDE_34) @@ -8,18 +8,14 @@ -

    Module Include_functor.Make

    -

    This module demonstratest the include functor - functionality +

    This module demonstrates the include functor functionality

    diff --git a/test/generators/html/Oxcaml_impl-Include_functor.html b/test/generators/html/Oxcaml_impl-Include_functor.html index 0ad6f118b5..7e4b6a2de1 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor.html +++ b/test/generators/html/Oxcaml_impl-Include_functor.html @@ -16,6 +16,19 @@

    Module Oxcaml_impl.Include_functor

    +
    +
    + + + module + BODY_4 + + : sig ... + end + + +
    +
    @@ -32,7 +45,7 @@

    Module Oxcaml_impl.Include_functor

    -

    This module demonstratest the include functor +

    This module demonstrates the include functor functionality

    @@ -55,7 +68,13 @@

    Module Oxcaml_impl.Include_functor

    - type included + type included + = + + Make(BODY_4).included + + +
    diff --git a/test/generators/html/Oxcaml_impl-No_include_functor-Make-argument-1-T.html b/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make-argument-1-T.html similarity index 73% rename from test/generators/html/Oxcaml_impl-No_include_functor-Make-argument-1-T.html rename to test/generators/html/Oxcaml_impl-Include_functor_desugared-Make-argument-1-T.html index cc2e3dc5a6..14793c7f83 100644 --- a/test/generators/html/Oxcaml_impl-No_include_functor-Make-argument-1-T.html +++ b/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make-argument-1-T.html @@ -1,6 +1,6 @@ - T (Oxcaml_impl.No_include_functor.Make.T) + T (Oxcaml_impl.Include_functor_desugared.Make.T) @@ -9,11 +9,13 @@
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html b/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html new file mode 100644 index 0000000000..440e823d37 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html @@ -0,0 +1,57 @@ + + + Make (Oxcaml_impl.Include_functor_desugared.Make) + + + + + + + + +
    +

    Module Include_functor_desugared.Make

    +

    This module is the desugared version from above

    +
    +
    + +
    +
    +

    Parameters +

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

    Signature

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

    Module Oxcaml_impl.Include_functor_desugared +

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

    This module is the desugared version from above

    +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + + include + sig ... end + + + +
    +
    + + type included + = + + Make(DUMMY__).included + + + +
    +
    +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-No_include_functor.html b/test/generators/html/Oxcaml_impl-No_include_functor.html deleted file mode 100644 index 83fa229532..0000000000 --- a/test/generators/html/Oxcaml_impl-No_include_functor.html +++ /dev/null @@ -1,104 +0,0 @@ - - - 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-No_include_functor-T.html b/test/generators/html/Oxcaml_impl-Resolve_functor-F-argument-1-I.html similarity index 70% rename from test/generators/html/Oxcaml_impl-No_include_functor-T.html rename to test/generators/html/Oxcaml_impl-Resolve_functor-F-argument-1-I.html index 78f282a825..fee0609c82 100644 --- a/test/generators/html/Oxcaml_impl-No_include_functor-T.html +++ b/test/generators/html/Oxcaml_impl-Resolve_functor-F-argument-1-I.html @@ -1,6 +1,6 @@ - T (Oxcaml_impl.No_include_functor.T) + I (Oxcaml_impl.Resolve_functor.F.I) @@ -8,14 +8,14 @@ -
    -
    -
    - - - module - BODY_31 - - : sig ... - end - - -
    -
    @@ -38,39 +25,6 @@

    Module Oxcaml.Anonymous_functor

    In this test case the functor is defined inline

    -
    -
    - - - module - INCLUDE_34 - - ( - T - : sig ... - end) : sig - ... end - - -
    -
    -
    -
    - - - module - APPLIED_35 - - : module - type of - struct - include - INCLUDE_34(BODY_31) - end - - -
    -
    @@ -90,13 +44,7 @@

    Module Oxcaml.Anonymous_functor

    - type included - = - - INCLUDE_34(BODY_31).included - - - + type included
    diff --git a/test/generators/html/Oxcaml-Include_functor-APPLIED_12.html b/test/generators/html/Oxcaml-Include_functor-APPLIED_12.html deleted file mode 100644 index 5b90ce12fe..0000000000 --- a/test/generators/html/Oxcaml-Include_functor-APPLIED_12.html +++ /dev/null @@ -1,32 +0,0 @@ - - - APPLIED_12 (Oxcaml.Include_functor.APPLIED_12) - - - - - - - - -
    -

    Module Include_functor.APPLIED_12

    -
    -
    -
    -
    - - type included - = - BODY_8.t - - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor-BODY_8.html b/test/generators/html/Oxcaml-Include_functor-BODY_8.html deleted file mode 100644 index b88e1522a7..0000000000 --- a/test/generators/html/Oxcaml-Include_functor-BODY_8.html +++ /dev/null @@ -1,59 +0,0 @@ - - - BODY_8 (Oxcaml.Include_functor.BODY_8) - - - - - - - - -
    -

    Module Include_functor.BODY_8

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

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

    -
    -
    -
    -
    - - type t -
    -
    -
    -
    - - module INCLUDE_11 - : module - type of - Make - - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html b/test/generators/html/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html deleted file mode 100644 index dde63d68db..0000000000 --- a/test/generators/html/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html +++ /dev/null @@ -1,30 +0,0 @@ - - - T (Oxcaml.Include_functor.INCLUDE_11.T) - - - - - - - - -
    -

    Parameter INCLUDE_11.T

    -
    -
    -
    -
    - - type t -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor-INCLUDE_11.html b/test/generators/html/Oxcaml-Include_functor-INCLUDE_11.html deleted file mode 100644 index c24d81f29f..0000000000 --- a/test/generators/html/Oxcaml-Include_functor-INCLUDE_11.html +++ /dev/null @@ -1,57 +0,0 @@ - - - INCLUDE_11 (Oxcaml.Include_functor.INCLUDE_11) - - - - - - - - -
    -

    Module Include_functor.INCLUDE_11

    -
    -
    - -
    -
    -

    Parameters -

    -
    -
    - - module - - T - - : sig ... - end - - -
    -
    -

    Signature

    -
    -
    - - type included - = - - T.t - - - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor.html b/test/generators/html/Oxcaml-Include_functor.html index c2f92029cb..594d713c26 100644 --- a/test/generators/html/Oxcaml-Include_functor.html +++ b/test/generators/html/Oxcaml-Include_functor.html @@ -16,19 +16,6 @@

    Module Oxcaml.Include_functor

    -
    -
    - - - module - BODY_8 - - : sig ... - end - - -
    -
    @@ -55,37 +42,6 @@

    Module Oxcaml.Include_functor

    type t
    -
    -
    - - - module - INCLUDE_11 - - : module - type of - Make - - -
    -
    -
    -
    - - - module - APPLIED_12 - - : module - type of - struct - include - INCLUDE_11(BODY_8) - end - - -
    -
    @@ -100,11 +56,7 @@

    Module Oxcaml.Include_functor

    - type included - = - BODY_8.t - - + type included
    diff --git a/test/generators/html/Oxcaml-Include_functor_inline-APPLIED_30.html b/test/generators/html/Oxcaml-Include_functor_inline-APPLIED_30.html deleted file mode 100644 index 198517c1ee..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_inline-APPLIED_30.html +++ /dev/null @@ -1,36 +0,0 @@ - - - APPLIED_30 (Oxcaml.Include_functor_inline.APPLIED_30) - - - - - - - - -
    -

    Module Include_functor_inline.APPLIED_30 -

    -
    -
    -
    -
    - - type included - = - - INCLUDE_29(BODY_26).included - - - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_inline-BODY_26.html b/test/generators/html/Oxcaml-Include_functor_inline-BODY_26.html deleted file mode 100644 index 76c470272e..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_inline-BODY_26.html +++ /dev/null @@ -1,65 +0,0 @@ - - - BODY_26 (Oxcaml.Include_functor_inline.BODY_26) - - - - - - - - -
    -

    Module Include_functor_inline.BODY_26

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

    This is a test case where the functor is named and included inline -

    -
    -
    -
    -
    - - type t -
    -
    -
    -
    - - module INCLUDE_29 - : - Make - - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html b/test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html deleted file mode 100644 index b8ed4ca1f5..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html +++ /dev/null @@ -1,32 +0,0 @@ - - - _ (Oxcaml.Include_functor_inline.INCLUDE_29._) - - - - - - - - -
    -

    Parameter INCLUDE_29._

    -
    -
    -
    -
    - - type t -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29.html b/test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29.html deleted file mode 100644 index 4e935c1429..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_inline-INCLUDE_29.html +++ /dev/null @@ -1,54 +0,0 @@ - - - INCLUDE_29 (Oxcaml.Include_functor_inline.INCLUDE_29) - - - - - - - - -
    -

    Module Include_functor_inline.INCLUDE_29 -

    -
    -
    - -
    -
    -

    Parameters -

    -
    -
    - - module - - _ - - - : sig ... - end - - -
    -
    -

    Signature

    -
    -
    - - type included -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_inline.html b/test/generators/html/Oxcaml-Include_functor_inline.html index ecd9ff1b31..ba7a297d4c 100644 --- a/test/generators/html/Oxcaml-Include_functor_inline.html +++ b/test/generators/html/Oxcaml-Include_functor_inline.html @@ -16,19 +16,6 @@

    Module Oxcaml.Include_functor_inline

    -
    -
    - - - module - BODY_26 - - : sig ... - end - - -
    -
    @@ -61,37 +48,6 @@

    Module Oxcaml.Include_functor_inline

    type t
    -
    -
    - - - module - INCLUDE_29 - - : - Make - - -
    -
    -
    -
    - - - module - APPLIED_30 - - : module - type of - struct - include - - INCLUDE_29(BODY_26) - end - - -
    -
    @@ -105,14 +61,7 @@

    Module Oxcaml.Include_functor_inline

    - type included - = - - INCLUDE_29(BODY_26).included - - - + type included
    diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-APPLIED_25.html b/test/generators/html/Oxcaml-Include_functor_named_type-APPLIED_25.html deleted file mode 100644 index 40e48cb2b1..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_named_type-APPLIED_25.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - APPLIED_25 (Oxcaml.Include_functor_named_type.APPLIED_25) - - - - - - - - -
    -

    Module Include_functor_named_type.APPLIED_25 -

    -
    -
    -
    -
    - - type included - = - - INCLUDE_24(BODY_21).included - - - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-BODY_21.html b/test/generators/html/Oxcaml-Include_functor_named_type-BODY_21.html deleted file mode 100644 index be058b4222..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_named_type-BODY_21.html +++ /dev/null @@ -1,71 +0,0 @@ - - - BODY_21 (Oxcaml.Include_functor_named_type.BODY_21) - - - - - - - - -
    -

    Module Include_functor_named_type.BODY_21 -

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

    This is a module where the functor is named and then included.

    -
    -
    -
    -
    - - type t -
    -
    -
    -
    - - module INCLUDE_24 - : - - MakeType - - - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html b/test/generators/html/Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html deleted file mode 100644 index ffd668edce..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html +++ /dev/null @@ -1,33 +0,0 @@ - - - _ (Oxcaml.Include_functor_named_type.INCLUDE_24._) - - - - - - - - -
    -

    Parameter INCLUDE_24._

    -
    -
    -
    -
    - - type t -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-INCLUDE_24.html b/test/generators/html/Oxcaml-Include_functor_named_type-INCLUDE_24.html deleted file mode 100644 index 77976ab2f7..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_named_type-INCLUDE_24.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - INCLUDE_24 (Oxcaml.Include_functor_named_type.INCLUDE_24) - - - - - - - - -
    -

    Module Include_functor_named_type.INCLUDE_24 -

    -
    -
    - -
    -
    -

    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 index 1c59159661..40746997c9 100644 --- a/test/generators/html/Oxcaml-Include_functor_named_type.html +++ b/test/generators/html/Oxcaml-Include_functor_named_type.html @@ -18,19 +18,6 @@

    Module Oxcaml.Include_functor_named_type

    -
    -
    - - - module - BODY_21 - - : sig ... - end - - -
    -
    @@ -64,41 +51,6 @@

    Module Oxcaml.Include_functor_named_type type t

    -
    -
    - - - module - INCLUDE_24 - - - : - - MakeType - - - -
    -
    -
    -
    - - - module - APPLIED_25 - - - : module - type of - struct - include - - INCLUDE_24(BODY_21) - end - - -
    -
    @@ -113,14 +65,7 @@

    Module Oxcaml.Include_functor_named_type
    - type included - = - INCLUDE_24(BODY_21).included - - - + type included

    diff --git a/test/generators/html/Oxcaml_impl-Include_functor-BODY_4.html b/test/generators/html/Oxcaml_impl-Include_functor-BODY_4.html deleted file mode 100644 index ba22d41546..0000000000 --- a/test/generators/html/Oxcaml_impl-Include_functor-BODY_4.html +++ /dev/null @@ -1,50 +0,0 @@ - - - BODY_4 (Oxcaml_impl.Include_functor.BODY_4) - - - - - - - - -
    -

    Module Include_functor.BODY_4

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

    This module demonstrates the include functor - functionality -

    -
    -
    -
    -
    - - type t -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml_impl-Include_functor.html b/test/generators/html/Oxcaml_impl-Include_functor.html index 7e4b6a2de1..99fec2ddde 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor.html +++ b/test/generators/html/Oxcaml_impl-Include_functor.html @@ -16,19 +16,6 @@

    Module Oxcaml_impl.Include_functor

    -
    -
    - - - module - BODY_4 - - : sig ... - end - - -
    -
    @@ -68,13 +55,7 @@

    Module Oxcaml_impl.Include_functor

    - type included - = - - Make(BODY_4).included - - - + type included
    diff --git a/test/generators/html/Oxcaml_impl-Resolve_functor-M-BODY_14.html b/test/generators/html/Oxcaml_impl-Resolve_functor-M-BODY_14.html deleted file mode 100644 index 6740dd4b54..0000000000 --- a/test/generators/html/Oxcaml_impl-Resolve_functor-M-BODY_14.html +++ /dev/null @@ -1,31 +0,0 @@ - - - BODY_14 (Oxcaml_impl.Resolve_functor.M.BODY_14) - - - - - - - - -
    -

    Module M.BODY_14

    -
    -
    -
    -
    - - type t - = float - -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml_impl-Resolve_functor-M.html b/test/generators/html/Oxcaml_impl-Resolve_functor-M.html index edbbb506b7..7db2b44653 100644 --- a/test/generators/html/Oxcaml_impl-Resolve_functor-M.html +++ b/test/generators/html/Oxcaml_impl-Resolve_functor-M.html @@ -18,19 +18,6 @@

    Module Resolve_functor.M

    -
    -
    - - - module - BODY_14 - - : sig ... - end - - -
    -
    @@ -52,11 +39,7 @@

    Module Resolve_functor.M

    type myt - = - - BODY_14.t - - + = float
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index 93aa4491b0..8fd752f548 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -13,14 +13,8 @@ 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-BODY_8.html Oxcaml-Include_functor-Make.html Oxcaml-Include_functor-Make-argument-1-T.html -Oxcaml-Include_functor-Make.html -Oxcaml-Include_functor-Make-argument-1-T.html -Oxcaml-Include_functor-INCLUDE_11.html -Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html -Oxcaml-Include_functor-APPLIED_12.html Oxcaml-Include_functor_desugared.html Oxcaml-Include_functor_desugared-Make.html Oxcaml-Include_functor_desugared-Make-argument-1-T.html @@ -28,28 +22,10 @@ Oxcaml-Include_functor_named_type_desugared.html Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.html Oxcaml-Include_functor_named_type.html -Oxcaml-Include_functor_named_type-BODY_21.html -Oxcaml-Include_functor_named_type-module-type-MakeType.html -Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html Oxcaml-Include_functor_named_type-module-type-MakeType.html Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html -Oxcaml-Include_functor_named_type-INCLUDE_24.html -Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html -Oxcaml-Include_functor_named_type-APPLIED_25.html Oxcaml-Include_functor_inline.html -Oxcaml-Include_functor_inline-BODY_26.html -Oxcaml-Include_functor_inline-module-type-Make.html -Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html Oxcaml-Include_functor_inline-module-type-Make.html Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html -Oxcaml-Include_functor_inline-INCLUDE_29.html -Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html -Oxcaml-Include_functor_inline-APPLIED_30.html Oxcaml-Anonymous_functor.html -Oxcaml-Anonymous_functor-BODY_31.html -Oxcaml-Anonymous_functor-INCLUDE_34.html -Oxcaml-Anonymous_functor-include10_-argument-1-T.html -Oxcaml-Anonymous_functor-INCLUDE_34.html -Oxcaml-Anonymous_functor-include10_-argument-1-T.html -Oxcaml-Anonymous_functor-APPLIED_35.html Oxcaml-Anonymous_functor_desugared.html diff --git a/test/generators/html/oxcaml_impl.targets b/test/generators/html/oxcaml_impl.targets index e838c9bede..f6f2b8cd6c 100644 --- a/test/generators/html/oxcaml_impl.targets +++ b/test/generators/html/oxcaml_impl.targets @@ -2,9 +2,6 @@ Oxcaml_impl.html Oxcaml_impl-To_be_included.html Oxcaml_impl-Including.html Oxcaml_impl-Include_functor.html -Oxcaml_impl-Include_functor-BODY_4.html -Oxcaml_impl-Include_functor-Make.html -Oxcaml_impl-Include_functor-Make-argument-1-T.html Oxcaml_impl-Include_functor-Make.html Oxcaml_impl-Include_functor-Make-argument-1-T.html Oxcaml_impl-Include_functor_desugared.html @@ -14,4 +11,3 @@ Oxcaml_impl-Resolve_functor.html Oxcaml_impl-Resolve_functor-F.html Oxcaml_impl-Resolve_functor-F-argument-1-I.html Oxcaml_impl-Resolve_functor-M.html -Oxcaml_impl-Resolve_functor-M-BODY_14.html diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index f79f14a90e..05703bc5bb 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -404,18 +404,10 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \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-BODY_8}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor-BODY_8]{\ocamlinlinecode{BODY\_\allowbreak{}8}}}\label{Oxcaml-Include_functor-BODY_8}\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}% +\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\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}\\ -\label{Oxcaml-Include_functor--module-INCLUDE_11}\ocamlcodefragment{\ocamltag{keyword}{module} INCLUDE\_\allowbreak{}11 : \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor-Make]{\ocamlinlinecode{Make}}}\\ -\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-Include_functor-BODY_8]{\ocamlinlinecode{BODY\_\allowbreak{}8}} \ocamltag{keyword}{end}\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}\\ -\label{Oxcaml-Include_functor--module-INCLUDE_11}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor-INCLUDE_11]{\ocamlinlinecode{INCLUDE\_\allowbreak{}11}}}\ocamlcodefragment{ : \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor-Make]{\ocamlinlinecode{Make}}}\\ -\label{Oxcaml-Include_functor--module-APPLIED_12}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor-APPLIED_12]{\ocamlinlinecode{APPLIED\_\allowbreak{}12}}}\ocamlcodefragment{ : \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[Oxcaml-Include_functor-INCLUDE_11]{\ocamlinlinecode{INCLUDE\_\allowbreak{}11(BODY\_\allowbreak{}8)}} \ocamltag{keyword}{end}}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor-BODY_8--type-t]{\ocamlinlinecode{BODY\_\allowbreak{}8.\allowbreak{}t}}}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \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_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_desugared--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_desugared-Make-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ @@ -423,11 +415,11 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Include_functor_named_type_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_named_type_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--parameters_6}}% +\label{Oxcaml--module-Include_functor_named_type_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_named_type_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--parameters_4}}% \label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--signature_6}}% +\subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--signature_4}}% \label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% @@ -436,72 +428,35 @@ \subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-modul \ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_named_type_desugared--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-BODY_21}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-BODY_21]{\ocamlinlinecode{BODY\_\allowbreak{}21}}}\label{Oxcaml-Include_functor_named_type-BODY_21}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_7}}% -\label{Oxcaml-Include_functor_named_type-module-type-MakeType--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-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-MakeType--signature_7}}% -\label{Oxcaml-Include_functor_named_type-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ -\end{ocamlindent}% -\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% -\medbreak -\label{Oxcaml-Include_functor_named_type--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\label{Oxcaml-Include_functor_named_type--module-INCLUDE_24}\ocamlcodefragment{\ocamltag{keyword}{module} INCLUDE\_\allowbreak{}24 : \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\\ -\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-Include_functor_named_type-BODY_21]{\ocamlinlinecode{BODY\_\allowbreak{}21}} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_8}}% +\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_5}}% \label{Oxcaml-Include_functor_named_type-module-type-MakeType--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_8}}% +\subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_5}}% \label{Oxcaml-Include_functor_named_type-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% \medbreak \label{Oxcaml-Include_functor_named_type--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\label{Oxcaml-Include_functor_named_type--module-INCLUDE_24}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-INCLUDE_24]{\ocamlinlinecode{INCLUDE\_\allowbreak{}24}}}\ocamlcodefragment{ : \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\\ -\label{Oxcaml-Include_functor_named_type--module-APPLIED_25}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-APPLIED_25]{\ocamlinlinecode{APPLIED\_\allowbreak{}25}}}\ocamlcodefragment{ : \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[Oxcaml-Include_functor_named_type-INCLUDE_24]{\ocamlinlinecode{INCLUDE\_\allowbreak{}24(BODY\_\allowbreak{}21)}} \ocamltag{keyword}{end}}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_named_type-INCLUDE_24--type-included]{\ocamlinlinecode{INCLUDE\_\allowbreak{}24(BODY\_\allowbreak{}21).\allowbreak{}included}}}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline--module-BODY_26}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-BODY_26]{\ocamlinlinecode{BODY\_\allowbreak{}26}}}\label{Oxcaml-Include_functor_inline-BODY_26}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_10}}% +\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_6}}% \label{Oxcaml-Include_functor_inline-module-type-Make--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-module-type-Make-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsubsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_10}}% +\subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_6}}% \label{Oxcaml-Include_functor_inline-module-type-Make--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a test case where the functor is named and included inline\end{ocamlindent}% \medbreak \label{Oxcaml-Include_functor_inline--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\label{Oxcaml-Include_functor_inline--module-INCLUDE_29}\ocamlcodefragment{\ocamltag{keyword}{module} INCLUDE\_\allowbreak{}29 : \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\\ -\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-Include_functor_inline-BODY_26]{\ocamlinlinecode{BODY\_\allowbreak{}26}} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_11}}% -\label{Oxcaml-Include_functor_inline-module-type-Make--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-module-type-Make-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\end{ocamlindent}% -\ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_11}}% -\label{Oxcaml-Include_functor_inline-module-type-Make--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ -\end{ocamlindent}% -\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a test case where the functor is named and included inline\end{ocamlindent}% -\medbreak -\label{Oxcaml-Include_functor_inline--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\label{Oxcaml-Include_functor_inline--module-INCLUDE_29}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-INCLUDE_29]{\ocamlinlinecode{INCLUDE\_\allowbreak{}29}}}\ocamlcodefragment{ : \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\\ -\label{Oxcaml-Include_functor_inline--module-APPLIED_30}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-APPLIED_30]{\ocamlinlinecode{APPLIED\_\allowbreak{}30}}}\ocamlcodefragment{ : \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[Oxcaml-Include_functor_inline-INCLUDE_29]{\ocamlinlinecode{INCLUDE\_\allowbreak{}29(BODY\_\allowbreak{}26)}} \ocamltag{keyword}{end}}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_inline--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_inline-INCLUDE_29--type-included]{\ocamlinlinecode{INCLUDE\_\allowbreak{}29(BODY\_\allowbreak{}26).\allowbreak{}included}}}\\ -\end{ocamlindent}% -\ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Anonymous_functor--module-BODY_31}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor-BODY_31]{\ocamlinlinecode{BODY\_\allowbreak{}31}}}\label{Oxcaml-Anonymous_functor-BODY_31}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}In this test case the functor is defined inline\end{ocamlindent}% -\medbreak -\label{Oxcaml-Anonymous_functor--module-INCLUDE_34}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor-INCLUDE_34]{\ocamlinlinecode{INCLUDE\_\allowbreak{}34}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Anonymous_functor-include10_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_inline--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \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-Anonymous_functor-BODY_31]{\ocamlinlinecode{BODY\_\allowbreak{}31}} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}In this test case the functor is defined inline\end{ocamlindent}% +\label{Oxcaml--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}In this test case the functor is defined inline\end{ocamlindent}% \medbreak -\label{Oxcaml-Anonymous_functor--module-INCLUDE_34}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor-INCLUDE_34]{\ocamlinlinecode{INCLUDE\_\allowbreak{}34}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Anonymous_functor-include10_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ -\label{Oxcaml-Anonymous_functor--module-APPLIED_35}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor-APPLIED_35]{\ocamlinlinecode{APPLIED\_\allowbreak{}35}}}\ocamlcodefragment{ : \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \ocamltag{keyword}{struct} \ocamltag{keyword}{include} \hyperref[Oxcaml-Anonymous_functor-INCLUDE_34]{\ocamlinlinecode{INCLUDE\_\allowbreak{}34(BODY\_\allowbreak{}31)}} \ocamltag{keyword}{end}}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml-Anonymous_functor-include10_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Anonymous_functor-INCLUDE_34--type-included]{\ocamlinlinecode{INCLUDE\_\allowbreak{}34(BODY\_\allowbreak{}31).\allowbreak{}included}}}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml-Anonymous_functor-include10_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Anonymous_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor_desugared]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml-Anonymous_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Anonymous_functor_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index 87ffb79c5b..167470e7eb 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -45,15 +45,10 @@ \subsubsection{Modes on values\label{Oxcaml_impl--modes-on-values}}% \label{Oxcaml_impl--val-mode_multi}\ocamlcodefragment{\ocamltag{keyword}{val} mode\_\allowbreak{}multi : string @ local once \ocamltag{arrow}{$\rightarrow$} string @ local once}\begin{ocamlindent}Multiple modes on argument and return.\end{ocamlindent}% \medbreak \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on-structures}}% -\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-BODY_4}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor-BODY_4]{\ocamlinlinecode{BODY\_\allowbreak{}4}}}\label{Oxcaml_impl-Include_functor-BODY_4}\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 demonstrates the \ocamlinlinecode{include functor} functionality\end{ocamlindent}% +\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\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 demonstrates the \ocamlinlinecode{include functor} functionality\end{ocamlindent}% \medbreak \label{Oxcaml_impl-Include_functor--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-Include_functor-BODY_4]{\ocamlinlinecode{BODY\_\allowbreak{}4}} \ocamltag{keyword}{end}\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 demonstrates 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 = \hyperref[Oxcaml_impl-Include_functor-Make--type-included]{\ocamlinlinecode{Make(BODY\_\allowbreak{}4).\allowbreak{}included}}}\\ +\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}}\\ \label{Oxcaml_impl--module-Include_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml_impl-Include_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Include_functor_desugared--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_desugared-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Include_functor_desugared-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 is the desugared version from above\end{ocamlindent}% @@ -63,11 +58,8 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Resolve_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor]{\ocamlinlinecode{Resolve\_\allowbreak{}functor}}}\label{Oxcaml_impl-Resolve_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor--module-F}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Resolve_functor-F-argument-1-I]{\ocamlinlinecode{I}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ -\label{Oxcaml_impl-Resolve_functor--module-M}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-M]{\ocamlinlinecode{M}}}\label{Oxcaml_impl-Resolve_functor-M}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor-M--module-BODY_14}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-M-BODY_14]{\ocamlinlinecode{BODY\_\allowbreak{}14}}}\label{Oxcaml_impl-Resolve_functor-M-BODY_14}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor-M--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = float}\\ -\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-Resolve_functor-M-BODY_14]{\ocamlinlinecode{BODY\_\allowbreak{}14}} \ocamltag{keyword}{end}\label{Oxcaml_impl-Resolve_functor-M--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = float}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}\label{Oxcaml_impl-Resolve_functor-M--type-myt}\ocamlcodefragment{\ocamltag{keyword}{type} myt = \hyperref[Oxcaml_impl-Resolve_functor-M-BODY_14--type-t]{\ocamlinlinecode{BODY\_\allowbreak{}14.\allowbreak{}t}}}\\ +\label{Oxcaml_impl-Resolve_functor--module-M}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-M]{\ocamlinlinecode{M}}}\label{Oxcaml_impl-Resolve_functor-M}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml_impl-Resolve_functor-M--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = float}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}\label{Oxcaml_impl-Resolve_functor-M--type-myt}\ocamlcodefragment{\ocamltag{keyword}{type} myt = float}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \end{ocamlindent}% diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index 4684e379f8..711a493c03 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11962,14 +11962,8 @@ 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-BODY_8.html.gen Oxcaml-Include_functor-Make.html.gen Oxcaml-Include_functor-Make-argument-1-T.html.gen - Oxcaml-Include_functor-Make.html.gen - Oxcaml-Include_functor-Make-argument-1-T.html.gen - Oxcaml-Include_functor-INCLUDE_11.html.gen - Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html.gen - Oxcaml-Include_functor-APPLIED_12.html.gen Oxcaml-Include_functor_desugared.html.gen Oxcaml-Include_functor_desugared-Make.html.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.html.gen @@ -11977,30 +11971,12 @@ Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html.gen Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.html.gen Oxcaml-Include_functor_named_type.html.gen - Oxcaml-Include_functor_named_type-BODY_21.html.gen - Oxcaml-Include_functor_named_type-module-type-MakeType.html.gen - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html.gen Oxcaml-Include_functor_named_type-module-type-MakeType.html.gen Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html.gen - Oxcaml-Include_functor_named_type-INCLUDE_24.html.gen - Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html.gen - Oxcaml-Include_functor_named_type-APPLIED_25.html.gen Oxcaml-Include_functor_inline.html.gen - Oxcaml-Include_functor_inline-BODY_26.html.gen Oxcaml-Include_functor_inline-module-type-Make.html.gen Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html.gen - Oxcaml-Include_functor_inline-module-type-Make.html.gen - Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html.gen - Oxcaml-Include_functor_inline-INCLUDE_29.html.gen - Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html.gen - Oxcaml-Include_functor_inline-APPLIED_30.html.gen Oxcaml-Anonymous_functor.html.gen - Oxcaml-Anonymous_functor-BODY_31.html.gen - Oxcaml-Anonymous_functor-INCLUDE_34.html.gen - Oxcaml-Anonymous_functor-include10_-argument-1-T.html.gen - Oxcaml-Anonymous_functor-INCLUDE_34.html.gen - Oxcaml-Anonymous_functor-include10_-argument-1-T.html.gen - Oxcaml-Anonymous_functor-APPLIED_35.html.gen Oxcaml-Anonymous_functor_desugared.html.gen) (package odoc) (action @@ -12113,14 +12089,6 @@ (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-BODY_8.html - Oxcaml-Include_functor-BODY_8.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12137,46 +12105,6 @@ 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-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-INCLUDE_11.html - Oxcaml-Include_functor-INCLUDE_11.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html - Oxcaml-Include_functor-INCLUDE_11-argument-1-T.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor-APPLIED_12.html - Oxcaml-Include_functor-APPLIED_12.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12233,30 +12161,6 @@ 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-BODY_21.html - Oxcaml-Include_functor_named_type-BODY_21.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-module-type-MakeType.html - Oxcaml-Include_functor_named_type-module-type-MakeType.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12273,30 +12177,6 @@ Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-INCLUDE_24.html - Oxcaml-Include_functor_named_type-INCLUDE_24.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html - Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-APPLIED_25.html - Oxcaml-Include_functor_named_type-APPLIED_25.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12305,14 +12185,6 @@ Oxcaml-Include_functor_inline.html Oxcaml-Include_functor_inline.html.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-BODY_26.html - Oxcaml-Include_functor_inline-BODY_26.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12329,100 +12201,12 @@ Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-module-type-Make.html - Oxcaml-Include_functor_inline-module-type-Make.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html - Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-INCLUDE_29.html - Oxcaml-Include_functor_inline-INCLUDE_29.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html - Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-APPLIED_30.html - Oxcaml-Include_functor_inline-APPLIED_30.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) (action (diff Oxcaml-Anonymous_functor.html Oxcaml-Anonymous_functor.html.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-BODY_31.html - Oxcaml-Anonymous_functor-BODY_31.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-INCLUDE_34.html - Oxcaml-Anonymous_functor-INCLUDE_34.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-include10_-argument-1-T.html - Oxcaml-Anonymous_functor-include10_-argument-1-T.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-INCLUDE_34.html - Oxcaml-Anonymous_functor-INCLUDE_34.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-include10_-argument-1-T.html - Oxcaml-Anonymous_functor-include10_-argument-1-T.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-APPLIED_35.html - Oxcaml-Anonymous_functor-APPLIED_35.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12518,27 +12302,13 @@ Oxcaml.No_include_functor.Make.3o.gen Oxcaml.No_include_functor.T.3o.gen Oxcaml.Include_functor.3o.gen - Oxcaml.Include_functor.BODY_8.3o.gen - Oxcaml.Include_functor.Make.3o.gen Oxcaml.Include_functor.Make.3o.gen - Oxcaml.Include_functor.INCLUDE_11.3o.gen - Oxcaml.Include_functor.APPLIED_12.3o.gen Oxcaml.Include_functor_desugared.3o.gen Oxcaml.Include_functor_desugared.Make.3o.gen Oxcaml.Include_functor_named_type_desugared.3o.gen Oxcaml.Include_functor_named_type.3o.gen - Oxcaml.Include_functor_named_type.BODY_21.3o.gen - Oxcaml.Include_functor_named_type.INCLUDE_24.3o.gen - Oxcaml.Include_functor_named_type.APPLIED_25.3o.gen Oxcaml.Include_functor_inline.3o.gen - Oxcaml.Include_functor_inline.BODY_26.3o.gen - Oxcaml.Include_functor_inline.INCLUDE_29.3o.gen - Oxcaml.Include_functor_inline.APPLIED_30.3o.gen Oxcaml.Anonymous_functor.3o.gen - Oxcaml.Anonymous_functor.BODY_31.3o.gen - Oxcaml.Anonymous_functor.INCLUDE_34.3o.gen - Oxcaml.Anonymous_functor.INCLUDE_34.3o.gen - Oxcaml.Anonymous_functor.APPLIED_35.3o.gen Oxcaml.Anonymous_functor_desugared.3o.gen) (package odoc) (action @@ -12612,42 +12382,12 @@ (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.BODY_8.3o - Oxcaml.Include_functor.BODY_8.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.Make.3o Oxcaml.Include_functor.Make.3o.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor.INCLUDE_11.3o - Oxcaml.Include_functor.INCLUDE_11.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor.APPLIED_12.3o - Oxcaml.Include_functor.APPLIED_12.3o.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12680,30 +12420,6 @@ Oxcaml.Include_functor_named_type.3o Oxcaml.Include_functor_named_type.3o.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor_named_type.BODY_21.3o - Oxcaml.Include_functor_named_type.BODY_21.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor_named_type.INCLUDE_24.3o - Oxcaml.Include_functor_named_type.INCLUDE_24.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor_named_type.APPLIED_25.3o - Oxcaml.Include_functor_named_type.APPLIED_25.3o.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12712,68 +12428,12 @@ Oxcaml.Include_functor_inline.3o Oxcaml.Include_functor_inline.3o.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor_inline.BODY_26.3o - Oxcaml.Include_functor_inline.BODY_26.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor_inline.INCLUDE_29.3o - Oxcaml.Include_functor_inline.INCLUDE_29.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Include_functor_inline.APPLIED_30.3o - Oxcaml.Include_functor_inline.APPLIED_30.3o.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) (action (diff Oxcaml.Anonymous_functor.3o Oxcaml.Anonymous_functor.3o.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Anonymous_functor.BODY_31.3o - Oxcaml.Anonymous_functor.BODY_31.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Anonymous_functor.INCLUDE_34.3o - Oxcaml.Anonymous_functor.INCLUDE_34.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Anonymous_functor.INCLUDE_34.3o - Oxcaml.Anonymous_functor.INCLUDE_34.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml.Anonymous_functor.APPLIED_35.3o - Oxcaml.Anonymous_functor.APPLIED_35.3o.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12819,14 +12479,8 @@ 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-BODY_8.md.gen - Oxcaml-Include_functor-Make.md.gen - Oxcaml-Include_functor-Make-argument-1-T.md.gen Oxcaml-Include_functor-Make.md.gen Oxcaml-Include_functor-Make-argument-1-T.md.gen - Oxcaml-Include_functor-INCLUDE_11.md.gen - Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md.gen - Oxcaml-Include_functor-APPLIED_12.md.gen Oxcaml-Include_functor_desugared.md.gen Oxcaml-Include_functor_desugared-Make.md.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.md.gen @@ -12834,30 +12488,12 @@ Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md.gen Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.md.gen Oxcaml-Include_functor_named_type.md.gen - Oxcaml-Include_functor_named_type-BODY_21.md.gen - Oxcaml-Include_functor_named_type-module-type-MakeType.md.gen - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md.gen Oxcaml-Include_functor_named_type-module-type-MakeType.md.gen Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md.gen - Oxcaml-Include_functor_named_type-INCLUDE_24.md.gen - Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md.gen - Oxcaml-Include_functor_named_type-APPLIED_25.md.gen Oxcaml-Include_functor_inline.md.gen - Oxcaml-Include_functor_inline-BODY_26.md.gen - Oxcaml-Include_functor_inline-module-type-Make.md.gen - Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md.gen Oxcaml-Include_functor_inline-module-type-Make.md.gen Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md.gen - Oxcaml-Include_functor_inline-INCLUDE_29.md.gen - Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md.gen - Oxcaml-Include_functor_inline-APPLIED_30.md.gen Oxcaml-Anonymous_functor.md.gen - Oxcaml-Anonymous_functor-BODY_31.md.gen - Oxcaml-Anonymous_functor-INCLUDE_34.md.gen - Oxcaml-Anonymous_functor-include10_-argument-1-T.md.gen - Oxcaml-Anonymous_functor-INCLUDE_34.md.gen - Oxcaml-Anonymous_functor-include10_-argument-1-T.md.gen - Oxcaml-Anonymous_functor-APPLIED_35.md.gen Oxcaml-Anonymous_functor_desugared.md.gen) (package odoc) (action @@ -12964,14 +12600,6 @@ (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-BODY_8.md - Oxcaml-Include_functor-BODY_8.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12986,44 +12614,6 @@ 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-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-INCLUDE_11.md - Oxcaml-Include_functor-INCLUDE_11.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md - Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor-APPLIED_12.md - Oxcaml-Include_functor-APPLIED_12.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -13080,30 +12670,6 @@ 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-BODY_21.md - Oxcaml-Include_functor_named_type-BODY_21.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-module-type-MakeType.md - Oxcaml-Include_functor_named_type-module-type-MakeType.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -13120,30 +12686,6 @@ Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-INCLUDE_24.md - Oxcaml-Include_functor_named_type-INCLUDE_24.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md - Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_named_type-APPLIED_25.md - Oxcaml-Include_functor_named_type-APPLIED_25.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -13152,30 +12694,6 @@ Oxcaml-Include_functor_inline.md Oxcaml-Include_functor_inline.md.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-BODY_26.md - Oxcaml-Include_functor_inline-BODY_26.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-module-type-Make.md - Oxcaml-Include_functor_inline-module-type-Make.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md - Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -13192,84 +12710,12 @@ Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-INCLUDE_29.md - Oxcaml-Include_functor_inline-INCLUDE_29.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md - Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_inline-APPLIED_30.md - Oxcaml-Include_functor_inline-APPLIED_30.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) (action (diff Oxcaml-Anonymous_functor.md Oxcaml-Anonymous_functor.md.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-BODY_31.md - Oxcaml-Anonymous_functor-BODY_31.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-INCLUDE_34.md - Oxcaml-Anonymous_functor-INCLUDE_34.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-include10_-argument-1-T.md - Oxcaml-Anonymous_functor-include10_-argument-1-T.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-INCLUDE_34.md - Oxcaml-Anonymous_functor-INCLUDE_34.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-include10_-argument-1-T.md - Oxcaml-Anonymous_functor-include10_-argument-1-T.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Anonymous_functor-APPLIED_35.md - Oxcaml-Anonymous_functor-APPLIED_35.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -13304,9 +12750,6 @@ Oxcaml_impl-To_be_included.html.gen Oxcaml_impl-Including.html.gen Oxcaml_impl-Include_functor.html.gen - Oxcaml_impl-Include_functor-BODY_4.html.gen - Oxcaml_impl-Include_functor-Make.html.gen - Oxcaml_impl-Include_functor-Make-argument-1-T.html.gen Oxcaml_impl-Include_functor-Make.html.gen Oxcaml_impl-Include_functor-Make-argument-1-T.html.gen Oxcaml_impl-Include_functor_desugared.html.gen @@ -13315,8 +12758,7 @@ Oxcaml_impl-Resolve_functor.html.gen Oxcaml_impl-Resolve_functor-F.html.gen Oxcaml_impl-Resolve_functor-F-argument-1-I.html.gen - Oxcaml_impl-Resolve_functor-M.html.gen - Oxcaml_impl-Resolve_functor-M-BODY_14.html.gen) + Oxcaml_impl-Resolve_functor-M.html.gen) (package odoc) (action (run @@ -13356,30 +12798,6 @@ 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-BODY_4.html - Oxcaml_impl-Include_functor-BODY_4.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})) (rule (alias runtest) (package odoc) @@ -13451,14 +12869,6 @@ (diff Oxcaml_impl-Resolve_functor-M.html Oxcaml_impl-Resolve_functor-M.html.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml_impl-Resolve_functor-M-BODY_14.html - Oxcaml_impl-Resolve_functor-M-BODY_14.html.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -13525,15 +12935,12 @@ Oxcaml_impl.To_be_included.3o.gen Oxcaml_impl.Including.3o.gen Oxcaml_impl.Include_functor.3o.gen - Oxcaml_impl.Include_functor.BODY_4.3o.gen - Oxcaml_impl.Include_functor.Make.3o.gen Oxcaml_impl.Include_functor.Make.3o.gen Oxcaml_impl.Include_functor_desugared.3o.gen Oxcaml_impl.Include_functor_desugared.Make.3o.gen Oxcaml_impl.Resolve_functor.3o.gen Oxcaml_impl.Resolve_functor.F.3o.gen - Oxcaml_impl.Resolve_functor.M.3o.gen - Oxcaml_impl.Resolve_functor.M.BODY_14.3o.gen) + Oxcaml_impl.Resolve_functor.M.3o.gen) (package odoc) (action (run @@ -13569,22 +12976,6 @@ (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.BODY_4.3o - Oxcaml_impl.Include_functor.BODY_4.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})) (rule (alias runtest) (package odoc) @@ -13630,14 +13021,6 @@ (diff Oxcaml_impl.Resolve_functor.M.3o Oxcaml_impl.Resolve_functor.M.3o.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml_impl.Resolve_functor.M.BODY_14.3o - Oxcaml_impl.Resolve_functor.M.BODY_14.3o.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -13665,9 +13048,6 @@ Oxcaml_impl-To_be_included.md.gen Oxcaml_impl-Including.md.gen Oxcaml_impl-Include_functor.md.gen - Oxcaml_impl-Include_functor-BODY_4.md.gen - Oxcaml_impl-Include_functor-Make.md.gen - Oxcaml_impl-Include_functor-Make-argument-1-T.md.gen Oxcaml_impl-Include_functor-Make.md.gen Oxcaml_impl-Include_functor-Make-argument-1-T.md.gen Oxcaml_impl-Include_functor_desugared.md.gen @@ -13676,8 +13056,7 @@ Oxcaml_impl-Resolve_functor.md.gen Oxcaml_impl-Resolve_functor-F.md.gen Oxcaml_impl-Resolve_functor-F-argument-1-I.md.gen - Oxcaml_impl-Resolve_functor-M.md.gen - Oxcaml_impl-Resolve_functor-M-BODY_14.md.gen) + Oxcaml_impl-Resolve_functor-M.md.gen) (package odoc) (action (run @@ -13713,30 +13092,6 @@ (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-BODY_4.md - Oxcaml_impl-Include_functor-BODY_4.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})) (rule (alias runtest) (package odoc) @@ -13806,14 +13161,6 @@ (diff Oxcaml_impl-Resolve_functor-M.md Oxcaml_impl-Resolve_functor-M.md.gen)) - (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml_impl-Resolve_functor-M-BODY_14.md - Oxcaml_impl-Resolve_functor-M-BODY_14.md.gen)) (enabled_if %{ocaml-config:ox}))) (subdir diff --git a/test/generators/man/Oxcaml.Anonymous_functor.3o b/test/generators/man/Oxcaml.Anonymous_functor.3o index 1224a92a7b..bd7cafd565 100644 --- a/test/generators/man/Oxcaml.Anonymous_functor.3o +++ b/test/generators/man/Oxcaml.Anonymous_functor.3o @@ -11,8 +11,6 @@ Oxcaml\.Anonymous_functor .SH Documentation .sp .nf -\f[CB]module\fR BODY_31 : \f[CB]sig\fR \.\.\. \f[CB]end\fR -.sp \f[CB]type\fR t .fi .br @@ -20,8 +18,4 @@ Oxcaml\.Anonymous_functor In this test case the functor is defined inline .nf .sp -\f[CB]module\fR INCLUDE_34 (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR -.sp -\f[CB]module\fR APPLIED_35 : \f[CB]module\fR \f[CB]type\fR \f[CB]of\fR \f[CB]struct\fR \f[CB]include\fR INCLUDE_34(BODY_31) \f[CB]end\fR -.sp -\f[CB]type\fR included = INCLUDE_34(BODY_31)\.included +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.Anonymous_functor.APPLIED_35.3o b/test/generators/man/Oxcaml.Anonymous_functor.APPLIED_35.3o deleted file mode 100644 index c78e181a4b..0000000000 --- a/test/generators/man/Oxcaml.Anonymous_functor.APPLIED_35.3o +++ /dev/null @@ -1,14 +0,0 @@ - -.TH APPLIED_35 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Anonymous_functor\.APPLIED_35 -.SH Synopsis -.sp -.in 2 -\fBModule Anonymous_functor\.APPLIED_35\fR -.in -.sp -.SH Documentation -.sp -.nf -\f[CB]type\fR included = INCLUDE_34(BODY_31)\.included diff --git a/test/generators/man/Oxcaml.Anonymous_functor.BODY_31.3o b/test/generators/man/Oxcaml.Anonymous_functor.BODY_31.3o deleted file mode 100644 index 0a13c7fa59..0000000000 --- a/test/generators/man/Oxcaml.Anonymous_functor.BODY_31.3o +++ /dev/null @@ -1,21 +0,0 @@ - -.TH BODY_31 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Anonymous_functor\.BODY_31 -.SH Synopsis -.sp -.in 2 -\fBModule Anonymous_functor\.BODY_31\fR -.in -.sp -.SH Documentation -.sp -.nf -\f[CB]type\fR t -.fi -.br -.ti +2 -In this test case the functor is defined inline -.nf -.sp -\f[CB]module\fR INCLUDE_34 (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR diff --git a/test/generators/man/Oxcaml.Anonymous_functor.INCLUDE_34.3o b/test/generators/man/Oxcaml.Anonymous_functor.INCLUDE_34.3o deleted file mode 100644 index af9b360661..0000000000 --- a/test/generators/man/Oxcaml.Anonymous_functor.INCLUDE_34.3o +++ /dev/null @@ -1,30 +0,0 @@ - -.TH INCLUDE_34 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Anonymous_functor\.INCLUDE_34 -.SH Synopsis -.sp -.in 2 -\fBModule Anonymous_functor\.INCLUDE_34\fR -.in -.sp -.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.3o b/test/generators/man/Oxcaml.Include_functor.3o index 852dc33440..a0776f720c 100644 --- a/test/generators/man/Oxcaml.Include_functor.3o +++ b/test/generators/man/Oxcaml.Include_functor.3o @@ -11,8 +11,6 @@ Oxcaml\.Include_functor .SH Documentation .sp .nf -\f[CB]module\fR BODY_8 : \f[CB]sig\fR \.\.\. \f[CB]end\fR -.sp \f[CB]module\fR Make (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR .fi .br @@ -22,8 +20,4 @@ Module which defines a functor and includes it via module type of .sp \f[CB]type\fR t .sp -\f[CB]module\fR INCLUDE_11 : \f[CB]module\fR \f[CB]type\fR \f[CB]of\fR Make -.sp -\f[CB]module\fR APPLIED_12 : \f[CB]module\fR \f[CB]type\fR \f[CB]of\fR \f[CB]struct\fR \f[CB]include\fR INCLUDE_11(BODY_8) \f[CB]end\fR -.sp -\f[CB]type\fR included = BODY_8\.t +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.Include_functor.APPLIED_12.3o b/test/generators/man/Oxcaml.Include_functor.APPLIED_12.3o deleted file mode 100644 index eba0c3f8fd..0000000000 --- a/test/generators/man/Oxcaml.Include_functor.APPLIED_12.3o +++ /dev/null @@ -1,14 +0,0 @@ - -.TH APPLIED_12 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor\.APPLIED_12 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor\.APPLIED_12\fR -.in -.sp -.SH Documentation -.sp -.nf -\f[CB]type\fR included = BODY_8\.t diff --git a/test/generators/man/Oxcaml.Include_functor.BODY_8.3o b/test/generators/man/Oxcaml.Include_functor.BODY_8.3o deleted file mode 100644 index b60c480c4b..0000000000 --- a/test/generators/man/Oxcaml.Include_functor.BODY_8.3o +++ /dev/null @@ -1,23 +0,0 @@ - -.TH BODY_8 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor\.BODY_8 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor\.BODY_8\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]module\fR INCLUDE_11 : \f[CB]module\fR \f[CB]type\fR \f[CB]of\fR Make diff --git a/test/generators/man/Oxcaml.Include_functor.INCLUDE_11.3o b/test/generators/man/Oxcaml.Include_functor.INCLUDE_11.3o deleted file mode 100644 index 02b644c253..0000000000 --- a/test/generators/man/Oxcaml.Include_functor.INCLUDE_11.3o +++ /dev/null @@ -1,30 +0,0 @@ - -.TH INCLUDE_11 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor\.INCLUDE_11 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor\.INCLUDE_11\fR -.in -.sp -.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 = T\.t diff --git a/test/generators/man/Oxcaml.Include_functor_inline.3o b/test/generators/man/Oxcaml.Include_functor_inline.3o index 5d2b5bf4a2..77c2a550f6 100644 --- a/test/generators/man/Oxcaml.Include_functor_inline.3o +++ b/test/generators/man/Oxcaml.Include_functor_inline.3o @@ -11,8 +11,6 @@ Oxcaml\.Include_functor_inline .SH Documentation .sp .nf -\f[CB]module\fR BODY_26 : \f[CB]sig\fR \.\.\. \f[CB]end\fR -.sp \f[CB]module\fR \f[CB]type\fR Make = \f[CB]sig\fR .br .ti +2 @@ -44,8 +42,4 @@ This is a test case where the functor is named and included inline .sp \f[CB]type\fR t .sp -\f[CB]module\fR INCLUDE_29 : Make -.sp -\f[CB]module\fR APPLIED_30 : \f[CB]module\fR \f[CB]type\fR \f[CB]of\fR \f[CB]struct\fR \f[CB]include\fR INCLUDE_29(BODY_26) \f[CB]end\fR -.sp -\f[CB]type\fR included = INCLUDE_29(BODY_26)\.included +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.Include_functor_inline.APPLIED_30.3o b/test/generators/man/Oxcaml.Include_functor_inline.APPLIED_30.3o deleted file mode 100644 index 115c8a5912..0000000000 --- a/test/generators/man/Oxcaml.Include_functor_inline.APPLIED_30.3o +++ /dev/null @@ -1,14 +0,0 @@ - -.TH APPLIED_30 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor_inline\.APPLIED_30 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor_inline\.APPLIED_30\fR -.in -.sp -.SH Documentation -.sp -.nf -\f[CB]type\fR included = INCLUDE_29(BODY_26)\.included diff --git a/test/generators/man/Oxcaml.Include_functor_inline.BODY_26.3o b/test/generators/man/Oxcaml.Include_functor_inline.BODY_26.3o deleted file mode 100644 index 8f2c8a1c36..0000000000 --- a/test/generators/man/Oxcaml.Include_functor_inline.BODY_26.3o +++ /dev/null @@ -1,45 +0,0 @@ - -.TH BODY_26 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor_inline\.BODY_26 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor_inline\.BODY_26\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 test case where the functor is named and included inline -.nf -.sp -\f[CB]type\fR t -.sp -\f[CB]module\fR INCLUDE_29 : Make diff --git a/test/generators/man/Oxcaml.Include_functor_inline.INCLUDE_29.3o b/test/generators/man/Oxcaml.Include_functor_inline.INCLUDE_29.3o deleted file mode 100644 index e9d6c7787d..0000000000 --- a/test/generators/man/Oxcaml.Include_functor_inline.INCLUDE_29.3o +++ /dev/null @@ -1,30 +0,0 @@ - -.TH INCLUDE_29 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor_inline\.INCLUDE_29 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor_inline\.INCLUDE_29\fR -.in -.sp -.SH Documentation -.sp -.nf -.sp -.in 3 -\fB1 Parameters\fR -.in -.sp -\f[CB]module\fR _ : \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 index beb48edab3..545ffb1499 100644 --- a/test/generators/man/Oxcaml.Include_functor_named_type.3o +++ b/test/generators/man/Oxcaml.Include_functor_named_type.3o @@ -11,8 +11,6 @@ Oxcaml\.Include_functor_named_type .SH Documentation .sp .nf -\f[CB]module\fR BODY_21 : \f[CB]sig\fR \.\.\. \f[CB]end\fR -.sp \f[CB]module\fR \f[CB]type\fR MakeType = \f[CB]sig\fR .br .ti +2 @@ -44,8 +42,4 @@ This is a module where the functor is named and then included\. .sp \f[CB]type\fR t .sp -\f[CB]module\fR INCLUDE_24 : MakeType -.sp -\f[CB]module\fR APPLIED_25 : \f[CB]module\fR \f[CB]type\fR \f[CB]of\fR \f[CB]struct\fR \f[CB]include\fR INCLUDE_24(BODY_21) \f[CB]end\fR -.sp -\f[CB]type\fR included = INCLUDE_24(BODY_21)\.included +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml.Include_functor_named_type.APPLIED_25.3o b/test/generators/man/Oxcaml.Include_functor_named_type.APPLIED_25.3o deleted file mode 100644 index 3813b65ffe..0000000000 --- a/test/generators/man/Oxcaml.Include_functor_named_type.APPLIED_25.3o +++ /dev/null @@ -1,14 +0,0 @@ - -.TH APPLIED_25 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor_named_type\.APPLIED_25 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor_named_type\.APPLIED_25\fR -.in -.sp -.SH Documentation -.sp -.nf -\f[CB]type\fR included = INCLUDE_24(BODY_21)\.included diff --git a/test/generators/man/Oxcaml.Include_functor_named_type.BODY_21.3o b/test/generators/man/Oxcaml.Include_functor_named_type.BODY_21.3o deleted file mode 100644 index feb019206a..0000000000 --- a/test/generators/man/Oxcaml.Include_functor_named_type.BODY_21.3o +++ /dev/null @@ -1,45 +0,0 @@ - -.TH BODY_21 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor_named_type\.BODY_21 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor_named_type\.BODY_21\fR -.in -.sp -.SH Documentation -.sp -.nf -\f[CB]module\fR \f[CB]type\fR MakeType = \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 functor is named and then included\. -.nf -.sp -\f[CB]type\fR t -.sp -\f[CB]module\fR INCLUDE_24 : MakeType diff --git a/test/generators/man/Oxcaml.Include_functor_named_type.INCLUDE_24.3o b/test/generators/man/Oxcaml.Include_functor_named_type.INCLUDE_24.3o deleted file mode 100644 index 6b9fb602fe..0000000000 --- a/test/generators/man/Oxcaml.Include_functor_named_type.INCLUDE_24.3o +++ /dev/null @@ -1,30 +0,0 @@ - -.TH INCLUDE_24 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml\.Include_functor_named_type\.INCLUDE_24 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor_named_type\.INCLUDE_24\fR -.in -.sp -.SH Documentation -.sp -.nf -.sp -.in 3 -\fB1 Parameters\fR -.in -.sp -\f[CB]module\fR _ : \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.Include_functor.3o b/test/generators/man/Oxcaml_impl.Include_functor.3o index 7d5b42e9d7..f6e8495987 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor.3o @@ -11,8 +11,6 @@ Oxcaml_impl\.Include_functor .SH Documentation .sp .nf -\f[CB]module\fR BODY_4 : \f[CB]sig\fR \.\.\. \f[CB]end\fR -.sp \f[CB]module\fR Make (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR .fi .br @@ -22,4 +20,4 @@ This module demonstrates the include functor functionality .sp \f[CB]type\fR t .sp -\f[CB]type\fR included = Make(BODY_4)\.included +\f[CB]type\fR included diff --git a/test/generators/man/Oxcaml_impl.Include_functor.BODY_4.3o b/test/generators/man/Oxcaml_impl.Include_functor.BODY_4.3o deleted file mode 100644 index 6e3ae0955c..0000000000 --- a/test/generators/man/Oxcaml_impl.Include_functor.BODY_4.3o +++ /dev/null @@ -1,21 +0,0 @@ - -.TH BODY_4 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml_impl\.Include_functor\.BODY_4 -.SH Synopsis -.sp -.in 2 -\fBModule Include_functor\.BODY_4\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 demonstrates the include functor functionality -.nf -.sp -\f[CB]type\fR t diff --git a/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o b/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o index e18abd8561..c4abc30f4a 100644 --- a/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o +++ b/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o @@ -11,8 +11,6 @@ Oxcaml_impl\.Resolve_functor\.M .SH Documentation .sp .nf -\f[CB]module\fR BODY_14 : \f[CB]sig\fR \.\.\. \f[CB]end\fR -.sp \f[CB]type\fR t = float .sp -\f[CB]type\fR myt = BODY_14\.t +\f[CB]type\fR myt = float diff --git a/test/generators/man/Oxcaml_impl.Resolve_functor.M.BODY_14.3o b/test/generators/man/Oxcaml_impl.Resolve_functor.M.BODY_14.3o deleted file mode 100644 index 3aeefb3bd2..0000000000 --- a/test/generators/man/Oxcaml_impl.Resolve_functor.M.BODY_14.3o +++ /dev/null @@ -1,14 +0,0 @@ - -.TH BODY_14 3 "" "Odoc" "OCaml Library" -.SH Name -Oxcaml_impl\.Resolve_functor\.M\.BODY_14 -.SH Synopsis -.sp -.in 2 -\fBModule M\.BODY_14\fR -.in -.sp -.SH Documentation -.sp -.nf -\f[CB]type\fR t = float diff --git a/test/generators/man/oxcaml.targets b/test/generators/man/oxcaml.targets index 88899ec30e..f889ffeca8 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -9,25 +9,11 @@ Oxcaml.No_include_functor.3o Oxcaml.No_include_functor.Make.3o Oxcaml.No_include_functor.T.3o Oxcaml.Include_functor.3o -Oxcaml.Include_functor.BODY_8.3o Oxcaml.Include_functor.Make.3o -Oxcaml.Include_functor.Make.3o -Oxcaml.Include_functor.INCLUDE_11.3o -Oxcaml.Include_functor.APPLIED_12.3o Oxcaml.Include_functor_desugared.3o Oxcaml.Include_functor_desugared.Make.3o Oxcaml.Include_functor_named_type_desugared.3o Oxcaml.Include_functor_named_type.3o -Oxcaml.Include_functor_named_type.BODY_21.3o -Oxcaml.Include_functor_named_type.INCLUDE_24.3o -Oxcaml.Include_functor_named_type.APPLIED_25.3o Oxcaml.Include_functor_inline.3o -Oxcaml.Include_functor_inline.BODY_26.3o -Oxcaml.Include_functor_inline.INCLUDE_29.3o -Oxcaml.Include_functor_inline.APPLIED_30.3o Oxcaml.Anonymous_functor.3o -Oxcaml.Anonymous_functor.BODY_31.3o -Oxcaml.Anonymous_functor.INCLUDE_34.3o -Oxcaml.Anonymous_functor.INCLUDE_34.3o -Oxcaml.Anonymous_functor.APPLIED_35.3o Oxcaml.Anonymous_functor_desugared.3o diff --git a/test/generators/man/oxcaml_impl.targets b/test/generators/man/oxcaml_impl.targets index 399348f290..67557b2c49 100644 --- a/test/generators/man/oxcaml_impl.targets +++ b/test/generators/man/oxcaml_impl.targets @@ -2,12 +2,9 @@ Oxcaml_impl.3o Oxcaml_impl.To_be_included.3o Oxcaml_impl.Including.3o Oxcaml_impl.Include_functor.3o -Oxcaml_impl.Include_functor.BODY_4.3o -Oxcaml_impl.Include_functor.Make.3o Oxcaml_impl.Include_functor.Make.3o Oxcaml_impl.Include_functor_desugared.3o Oxcaml_impl.Include_functor_desugared.Make.3o Oxcaml_impl.Resolve_functor.3o Oxcaml_impl.Resolve_functor.F.3o Oxcaml_impl.Resolve_functor.M.3o -Oxcaml_impl.Resolve_functor.M.BODY_14.3o diff --git a/test/generators/markdown/Oxcaml-Anonymous_functor-APPLIED_35.md b/test/generators/markdown/Oxcaml-Anonymous_functor-APPLIED_35.md deleted file mode 100644 index dbafe167be..0000000000 --- a/test/generators/markdown/Oxcaml-Anonymous_functor-APPLIED_35.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Module `Anonymous_functor.APPLIED_35` - -```ocaml -type included = INCLUDE_34(BODY_31).included -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Anonymous_functor-BODY_31.md b/test/generators/markdown/Oxcaml-Anonymous_functor-BODY_31.md deleted file mode 100644 index 375e160edd..0000000000 --- a/test/generators/markdown/Oxcaml-Anonymous_functor-BODY_31.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Module `Anonymous_functor.BODY_31` - -```ocaml -type t -``` -In this test case the functor is defined inline - -```ocaml -module INCLUDE_34 (T : sig ... end) : sig ... end -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Anonymous_functor-INCLUDE_34.md b/test/generators/markdown/Oxcaml-Anonymous_functor-INCLUDE_34.md deleted file mode 100644 index fcb0907b61..0000000000 --- a/test/generators/markdown/Oxcaml-Anonymous_functor-INCLUDE_34.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Module `Anonymous_functor.INCLUDE_34` - - -## Parameters - -```ocaml -module T : sig ... end -``` - -## Signature - -```ocaml -type included -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Anonymous_functor-include10_-argument-1-T.md b/test/generators/markdown/Oxcaml-Anonymous_functor-include10_-argument-1-T.md deleted file mode 100644 index c4b439d2a5..0000000000 --- a/test/generators/markdown/Oxcaml-Anonymous_functor-include10_-argument-1-T.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Parameter `include10_.T` - -```ocaml -type t -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Anonymous_functor.md b/test/generators/markdown/Oxcaml-Anonymous_functor.md index 417e5e51c9..41068a0c51 100644 --- a/test/generators/markdown/Oxcaml-Anonymous_functor.md +++ b/test/generators/markdown/Oxcaml-Anonymous_functor.md @@ -1,20 +1,11 @@ # Module `Oxcaml.Anonymous_functor` -```ocaml -module BODY_31 : sig ... end -``` ```ocaml type t ``` In this test case the functor is defined inline ```ocaml -module INCLUDE_34 (T : sig ... end) : sig ... end -``` -```ocaml -module APPLIED_35 : module type of struct include INCLUDE_34(BODY_31) end -``` -```ocaml -type included = INCLUDE_34(BODY_31).included +type included ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor-APPLIED_12.md b/test/generators/markdown/Oxcaml-Include_functor-APPLIED_12.md deleted file mode 100644 index a8a32c8acc..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor-APPLIED_12.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Module `Include_functor.APPLIED_12` - -```ocaml -type included = BODY_8.t -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor-BODY_8.md b/test/generators/markdown/Oxcaml-Include_functor-BODY_8.md deleted file mode 100644 index 97580fc5d7..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor-BODY_8.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Module `Include_functor.BODY_8` - -```ocaml -module Make (T : sig ... end) : sig ... end -``` -Module which defines a functor and includes it via `module type of` - -```ocaml -type t -``` -```ocaml -module INCLUDE_11 : module type of Make -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md b/test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md deleted file mode 100644 index 7fddf2a9e8..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Parameter `INCLUDE_11.T` - -```ocaml -type t -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11.md b/test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11.md deleted file mode 100644 index 9556a336d8..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor-INCLUDE_11.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Module `Include_functor.INCLUDE_11` - - -## Parameters - -```ocaml -module T : sig ... end -``` - -## Signature - -```ocaml -type included = T.t -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor.md b/test/generators/markdown/Oxcaml-Include_functor.md index cf9cc2958f..e54338a324 100644 --- a/test/generators/markdown/Oxcaml-Include_functor.md +++ b/test/generators/markdown/Oxcaml-Include_functor.md @@ -1,9 +1,6 @@ # Module `Oxcaml.Include_functor` -```ocaml -module BODY_8 : sig ... end -``` ```ocaml module Make (T : sig ... end) : sig ... end ``` @@ -13,11 +10,5 @@ Module which defines a functor and includes it via `module type of` type t ``` ```ocaml -module INCLUDE_11 : module type of Make -``` -```ocaml -module APPLIED_12 : module type of struct include INCLUDE_11(BODY_8) end -``` -```ocaml -type included = BODY_8.t +type included ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_inline-APPLIED_30.md b/test/generators/markdown/Oxcaml-Include_functor_inline-APPLIED_30.md deleted file mode 100644 index 74c846e7f8..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_inline-APPLIED_30.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Module `Include_functor_inline.APPLIED_30` - -```ocaml -type included = INCLUDE_29(BODY_26).included -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_inline-BODY_26.md b/test/generators/markdown/Oxcaml-Include_functor_inline-BODY_26.md deleted file mode 100644 index 96891871f8..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_inline-BODY_26.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Module `Include_functor_inline.BODY_26` - -```ocaml -module type Make = functor (_ : sig ... end) -> sig ... end -``` -This is a test case where the functor is named and included inline - -```ocaml -type t -``` -```ocaml -module INCLUDE_29 : Make -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md b/test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md deleted file mode 100644 index f8aecfc922..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Parameter `INCLUDE_29._` - -```ocaml -type t -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29.md b/test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29.md deleted file mode 100644 index ee81ff2cce..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_inline-INCLUDE_29.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Module `Include_functor_inline.INCLUDE_29` - - -## Parameters - -```ocaml -module _ : sig ... end -``` - -## Signature - -```ocaml -type included -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_inline.md b/test/generators/markdown/Oxcaml-Include_functor_inline.md index 6cd8be7db5..e431dfcf62 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_inline.md +++ b/test/generators/markdown/Oxcaml-Include_functor_inline.md @@ -1,9 +1,6 @@ # Module `Oxcaml.Include_functor_inline` -```ocaml -module BODY_26 : sig ... end -``` ```ocaml module type Make = functor (_ : sig ... end) -> sig ... end ``` @@ -13,11 +10,5 @@ This is a test case where the functor is named and included inline type t ``` ```ocaml -module INCLUDE_29 : Make -``` -```ocaml -module APPLIED_30 : module type of struct include INCLUDE_29(BODY_26) end -``` -```ocaml -type included = INCLUDE_29(BODY_26).included +type included ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-APPLIED_25.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-APPLIED_25.md deleted file mode 100644 index de36a5a33c..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type-APPLIED_25.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Module `Include_functor_named_type.APPLIED_25` - -```ocaml -type included = INCLUDE_24(BODY_21).included -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-BODY_21.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-BODY_21.md deleted file mode 100644 index 5a3ee2a771..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type-BODY_21.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Module `Include_functor_named_type.BODY_21` - -```ocaml -module type MakeType = functor (_ : sig ... end) -> sig ... end -``` -This is a module where the functor is named and then included. - -```ocaml -type t -``` -```ocaml -module INCLUDE_24 : MakeType -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md deleted file mode 100644 index fa083442ba..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Parameter `INCLUDE_24._` - -```ocaml -type t -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24.md deleted file mode 100644 index 477627e5b6..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type-INCLUDE_24.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Module `Include_functor_named_type.INCLUDE_24` - - -## 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 index ece32ad0d4..5addc812e9 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type.md +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type.md @@ -1,9 +1,6 @@ # Module `Oxcaml.Include_functor_named_type` -```ocaml -module BODY_21 : sig ... end -``` ```ocaml module type MakeType = functor (_ : sig ... end) -> sig ... end ``` @@ -13,11 +10,5 @@ This is a module where the functor is named and then included. type t ``` ```ocaml -module INCLUDE_24 : MakeType -``` -```ocaml -module APPLIED_25 : module type of struct include INCLUDE_24(BODY_21) end -``` -```ocaml -type included = INCLUDE_24(BODY_21).included +type included ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor-BODY_4.md b/test/generators/markdown/Oxcaml_impl-Include_functor-BODY_4.md deleted file mode 100644 index c4d96063f3..0000000000 --- a/test/generators/markdown/Oxcaml_impl-Include_functor-BODY_4.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Module `Include_functor.BODY_4` - -```ocaml -module Make (T : sig ... end) : sig ... end -``` -This module demonstrates the `include functor` functionality - -```ocaml -type t -``` \ 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 index 740b2c2dd3..ec1748f768 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor.md @@ -1,9 +1,6 @@ # Module `Oxcaml_impl.Include_functor` -```ocaml -module BODY_4 : sig ... end -``` ```ocaml module Make (T : sig ... end) : sig ... end ``` @@ -13,5 +10,5 @@ This module demonstrates the `include functor` functionality type t ``` ```ocaml -type included = Make(BODY_4).included +type included ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Resolve_functor-M-BODY_14.md b/test/generators/markdown/Oxcaml_impl-Resolve_functor-M-BODY_14.md deleted file mode 100644 index 02a57649eb..0000000000 --- a/test/generators/markdown/Oxcaml_impl-Resolve_functor-M-BODY_14.md +++ /dev/null @@ -1,6 +0,0 @@ - -# Module `M.BODY_14` - -```ocaml -type t = float -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md b/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md index 9e26a1163d..d724ddfc90 100644 --- a/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md +++ b/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md @@ -1,12 +1,9 @@ # Module `Resolve_functor.M` -```ocaml -module BODY_14 : sig ... end -``` ```ocaml type t = float ``` ```ocaml -type myt = BODY_14.t +type myt = float ``` \ No newline at end of file diff --git a/test/generators/markdown/oxcaml.targets b/test/generators/markdown/oxcaml.targets index 2b7e0e05d4..4be6eb5481 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -13,14 +13,8 @@ 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-BODY_8.md Oxcaml-Include_functor-Make.md Oxcaml-Include_functor-Make-argument-1-T.md -Oxcaml-Include_functor-Make.md -Oxcaml-Include_functor-Make-argument-1-T.md -Oxcaml-Include_functor-INCLUDE_11.md -Oxcaml-Include_functor-INCLUDE_11-argument-1-T.md -Oxcaml-Include_functor-APPLIED_12.md Oxcaml-Include_functor_desugared.md Oxcaml-Include_functor_desugared-Make.md Oxcaml-Include_functor_desugared-Make-argument-1-T.md @@ -28,28 +22,10 @@ Oxcaml-Include_functor_named_type_desugared.md Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.md Oxcaml-Include_functor_named_type.md -Oxcaml-Include_functor_named_type-BODY_21.md -Oxcaml-Include_functor_named_type-module-type-MakeType.md -Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md Oxcaml-Include_functor_named_type-module-type-MakeType.md Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md -Oxcaml-Include_functor_named_type-INCLUDE_24.md -Oxcaml-Include_functor_named_type-INCLUDE_24-argument-1-_.md -Oxcaml-Include_functor_named_type-APPLIED_25.md Oxcaml-Include_functor_inline.md -Oxcaml-Include_functor_inline-BODY_26.md -Oxcaml-Include_functor_inline-module-type-Make.md -Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md Oxcaml-Include_functor_inline-module-type-Make.md Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md -Oxcaml-Include_functor_inline-INCLUDE_29.md -Oxcaml-Include_functor_inline-INCLUDE_29-argument-1-_.md -Oxcaml-Include_functor_inline-APPLIED_30.md Oxcaml-Anonymous_functor.md -Oxcaml-Anonymous_functor-BODY_31.md -Oxcaml-Anonymous_functor-INCLUDE_34.md -Oxcaml-Anonymous_functor-include10_-argument-1-T.md -Oxcaml-Anonymous_functor-INCLUDE_34.md -Oxcaml-Anonymous_functor-include10_-argument-1-T.md -Oxcaml-Anonymous_functor-APPLIED_35.md Oxcaml-Anonymous_functor_desugared.md diff --git a/test/generators/markdown/oxcaml_impl.targets b/test/generators/markdown/oxcaml_impl.targets index 555c307302..572454bbee 100644 --- a/test/generators/markdown/oxcaml_impl.targets +++ b/test/generators/markdown/oxcaml_impl.targets @@ -2,9 +2,6 @@ Oxcaml_impl.md Oxcaml_impl-To_be_included.md Oxcaml_impl-Including.md Oxcaml_impl-Include_functor.md -Oxcaml_impl-Include_functor-BODY_4.md -Oxcaml_impl-Include_functor-Make.md -Oxcaml_impl-Include_functor-Make-argument-1-T.md Oxcaml_impl-Include_functor-Make.md Oxcaml_impl-Include_functor-Make-argument-1-T.md Oxcaml_impl-Include_functor_desugared.md @@ -14,4 +11,3 @@ Oxcaml_impl-Resolve_functor.md Oxcaml_impl-Resolve_functor-F.md Oxcaml_impl-Resolve_functor-F-argument-1-I.md Oxcaml_impl-Resolve_functor-M.md -Oxcaml_impl-Resolve_functor-M-BODY_14.md From 8b581e3e86e8e86918e44ba210267c3f17bc0ba0 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Mon, 31 Aug 2026 15:25:36 +0200 Subject: [PATCH 14/23] Update generated code with current `master` --- test/generators/latex/Oxcaml.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 05703bc5bb..adc1c2da69 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -415,11 +415,11 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Include_functor_named_type_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_named_type_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--parameters_4}}% +\label{Oxcaml--module-Include_functor_named_type_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_named_type_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--parameters_5}}% \label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--signature_4}}% +\subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--signature_5}}% \label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% @@ -428,11 +428,11 @@ \subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-modul \ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_named_type_desugared--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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_5}}% +\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_6}}% \label{Oxcaml-Include_functor_named_type-module-type-MakeType--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_5}}% +\subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_6}}% \label{Oxcaml-Include_functor_named_type-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% @@ -441,11 +441,11 @@ \subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeTy \ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_6}}% +\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_7}}% \label{Oxcaml-Include_functor_inline-module-type-Make--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-module-type-Make-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_6}}% +\subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_7}}% \label{Oxcaml-Include_functor_inline-module-type-Make--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a test case where the functor is named and included inline\end{ocamlindent}% From f0d6235aac8589bf621b58af8520cfff7c6cc429 Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Wed, 26 Aug 2026 16:51:13 +0100 Subject: [PATCH 15/23] Add tests for what `include functor` inherits and where it may appear Four new cases, plus two existing ones strengthened: - `Include_functor_argument_shapes` exercises everything the expansion of the functor can inherit from its argument - plain, parameterised and anonymously parameterised types, a submodule and a module type. - `Multiple_include_functors` has two `include functor`s with an item between them, and `Include_functor_not_last` a single one with an item after it. - `Include_functor_named_type`'s functor and `Oxcaml_impl.Include_functor`'s now use their argument. The structure side had no case that did, so the argument being ignored would have gone unnoticed there. Co-Authored-By: Claude Opus 5 (1M context) --- test/generators/cases/oxcaml.mli | 86 ++- test/generators/cases/oxcaml_impl.ml | 45 +- .../html/Oxcaml-Anonymous_functor.html | 4 +- ...r_argument_shapes-Make-argument-1-T-X.html | 34 + ...tor_argument_shapes-Make-argument-1-T.html | 73 ++ ...-Include_functor_argument_shapes-Make.html | 150 +++++ ...aml-Include_functor_argument_shapes-X.html | 32 + ...tor_argument_shapes-module-type-Arg-X.html | 33 + ...nctor_argument_shapes-module-type-Arg.html | 77 +++ ...rgument_shapes-module-type-Reexported.html | 34 + ...functor_argument_shapes-module-type-S.html | 33 + ...xcaml-Include_functor_argument_shapes.html | 194 ++++++ ...Oxcaml-Include_functor_desugared-Make.html | 6 + .../Oxcaml-Include_functor_desugared.html | 12 +- ...ype-module-type-MakeType-argument-1-X.html | 34 + ...nctor_named_type-module-type-MakeType.html | 17 +- .../Oxcaml-Include_functor_named_type.html | 4 +- ...red-module-type-MakeType-argument-1-X.html | 38 ++ ...d_type_desugared-module-type-MakeType.html | 24 +- ...-Include_functor_named_type_desugared.html | 14 +- ...de_functor_not_last-Make-argument-1-T.html | 31 + .../Oxcaml-Include_functor_not_last-Make.html | 62 ++ .../html/Oxcaml-Include_functor_not_last.html | 55 ++ ...e_include_functors-First-argument-1-T.html | 32 + ...xcaml-Multiple_include_functors-First.html | 64 ++ ..._include_functors-Second-argument-1-T.html | 44 ++ ...caml-Multiple_include_functors-Second.html | 74 ++ .../Oxcaml-Multiple_include_functors.html | 98 +++ test/generators/html/Oxcaml.html | 46 ++ .../html/Oxcaml_impl-Anonymous_functor.html | 41 ++ .../Oxcaml_impl-Include_functor-Make.html | 13 +- .../html/Oxcaml_impl-Include_functor.html | 4 +- ...l_impl-Include_functor_desugared-Make.html | 9 +- ...Oxcaml_impl-Include_functor_desugared.html | 7 +- ...de_functor_not_last-Make-argument-1-T.html | 33 + ...ml_impl-Include_functor_not_last-Make.html | 66 ++ .../Oxcaml_impl-Include_functor_not_last.html | 60 ++ ...e_include_functors-First-argument-1-T.html | 33 + ..._impl-Multiple_include_functors-First.html | 67 ++ ..._include_functors-Second-argument-1-T.html | 45 ++ ...impl-Multiple_include_functors-Second.html | 77 +++ ...Oxcaml_impl-Multiple_include_functors.html | 103 +++ test/generators/html/Oxcaml_impl.html | 43 ++ test/generators/html/oxcaml.targets | 21 +- test/generators/html/oxcaml_impl.targets | 9 + test/generators/latex/Oxcaml.tex | 84 ++- test/generators/latex/Oxcaml_impl.tex | 26 +- test/generators/link.dune.inc | 630 +++++++++++++++++- test/generators/man/Oxcaml.3o | 6 + .../Oxcaml.Include_functor_argument_shapes.3o | 100 +++ ...ml.Include_functor_argument_shapes.Make.3o | 82 +++ ...xcaml.Include_functor_argument_shapes.X.3o | 14 + .../man/Oxcaml.Include_functor_desugared.3o | 7 +- .../Oxcaml.Include_functor_desugared.Make.3o | 3 + .../man/Oxcaml.Include_functor_named_type.3o | 4 +- ...ml.Include_functor_named_type_desugared.3o | 8 +- .../man/Oxcaml.Include_functor_not_last.3o | 23 + .../Oxcaml.Include_functor_not_last.Make.3o | 33 + .../man/Oxcaml.Multiple_include_functors.3o | 29 + .../Oxcaml.Multiple_include_functors.First.3o | 33 + ...Oxcaml.Multiple_include_functors.Second.3o | 38 ++ test/generators/man/Oxcaml_impl.3o | 6 + .../man/Oxcaml_impl.Anonymous_functor.3o | 21 + .../man/Oxcaml_impl.Include_functor.3o | 2 +- .../man/Oxcaml_impl.Include_functor.Make.3o | 4 +- .../Oxcaml_impl.Include_functor_desugared.3o | 2 +- ...aml_impl.Include_functor_desugared.Make.3o | 2 +- .../Oxcaml_impl.Include_functor_not_last.3o | 23 + ...caml_impl.Include_functor_not_last.Make.3o | 33 + .../Oxcaml_impl.Multiple_include_functors.3o | 29 + ...ml_impl.Multiple_include_functors.First.3o | 33 + ...l_impl.Multiple_include_functors.Second.3o | 38 ++ test/generators/man/oxcaml.targets | 8 + test/generators/man/oxcaml_impl.targets | 6 + ...tor_argument_shapes-Make-argument-1-T-X.md | 6 + ...nctor_argument_shapes-Make-argument-1-T.md | 18 + ...ml-Include_functor_argument_shapes-Make.md | 36 + ...xcaml-Include_functor_argument_shapes-X.md | 6 + ...nctor_argument_shapes-module-type-Arg-X.md | 6 + ...functor_argument_shapes-module-type-Arg.md | 20 + ..._argument_shapes-module-type-Reexported.md | 8 + ...e_functor_argument_shapes-module-type-S.md | 6 + .../Oxcaml-Include_functor_argument_shapes.md | 50 ++ .../Oxcaml-Include_functor_desugared-Make.md | 2 + .../Oxcaml-Include_functor_desugared.md | 4 +- ..._type-module-type-MakeType-argument-1-X.md | 6 + ...functor_named_type-module-type-MakeType.md | 4 +- .../Oxcaml-Include_functor_named_type.md | 2 +- ...gared-module-type-MakeType-argument-1-X.md | 6 + ...med_type_desugared-module-type-MakeType.md | 6 +- ...ml-Include_functor_named_type_desugared.md | 6 +- ...lude_functor_not_last-Make-argument-1-T.md | 6 + .../Oxcaml-Include_functor_not_last-Make.md | 17 + .../Oxcaml-Include_functor_not_last.md | 14 + ...ple_include_functors-First-argument-1-T.md | 6 + .../Oxcaml-Multiple_include_functors-First.md | 17 + ...le_include_functors-Second-argument-1-T.md | 12 + ...Oxcaml-Multiple_include_functors-Second.md | 18 + .../Oxcaml-Multiple_include_functors.md | 23 + test/generators/markdown/Oxcaml.md | 9 + .../markdown/Oxcaml_impl-Anonymous_functor.md | 11 + .../Oxcaml_impl-Include_functor-Make.md | 4 +- .../markdown/Oxcaml_impl-Include_functor.md | 2 +- ...aml_impl-Include_functor_desugared-Make.md | 2 +- .../Oxcaml_impl-Include_functor_desugared.md | 2 +- ...lude_functor_not_last-Make-argument-1-T.md | 6 + ...caml_impl-Include_functor_not_last-Make.md | 17 + .../Oxcaml_impl-Include_functor_not_last.md | 14 + ...ple_include_functors-First-argument-1-T.md | 6 + ...ml_impl-Multiple_include_functors-First.md | 17 + ...le_include_functors-Second-argument-1-T.md | 12 + ...l_impl-Multiple_include_functors-Second.md | 18 + .../Oxcaml_impl-Multiple_include_functors.md | 23 + test/generators/markdown/Oxcaml_impl.md | 9 + test/generators/markdown/oxcaml.targets | 21 +- test/generators/markdown/oxcaml_impl.targets | 9 + 116 files changed, 3784 insertions(+), 111 deletions(-) create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-X.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-S.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html create mode 100644 test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html create mode 100644 test/generators/html/Oxcaml-Include_functor_not_last-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Include_functor_not_last-Make.html create mode 100644 test/generators/html/Oxcaml-Include_functor_not_last.html create mode 100644 test/generators/html/Oxcaml-Multiple_include_functors-First-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Multiple_include_functors-First.html create mode 100644 test/generators/html/Oxcaml-Multiple_include_functors-Second-argument-1-T.html create mode 100644 test/generators/html/Oxcaml-Multiple_include_functors-Second.html create mode 100644 test/generators/html/Oxcaml-Multiple_include_functors.html create mode 100644 test/generators/html/Oxcaml_impl-Anonymous_functor.html create mode 100644 test/generators/html/Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html create mode 100644 test/generators/html/Oxcaml_impl-Include_functor_not_last-Make.html create mode 100644 test/generators/html/Oxcaml_impl-Include_functor_not_last.html create mode 100644 test/generators/html/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html create mode 100644 test/generators/html/Oxcaml_impl-Multiple_include_functors-First.html create mode 100644 test/generators/html/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html create mode 100644 test/generators/html/Oxcaml_impl-Multiple_include_functors-Second.html create mode 100644 test/generators/html/Oxcaml_impl-Multiple_include_functors.html create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.X.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_not_last.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_not_last.Make.3o create mode 100644 test/generators/man/Oxcaml.Multiple_include_functors.3o create mode 100644 test/generators/man/Oxcaml.Multiple_include_functors.First.3o create mode 100644 test/generators/man/Oxcaml.Multiple_include_functors.Second.3o create mode 100644 test/generators/man/Oxcaml_impl.Anonymous_functor.3o create mode 100644 test/generators/man/Oxcaml_impl.Include_functor_not_last.3o create mode 100644 test/generators/man/Oxcaml_impl.Include_functor_not_last.Make.3o create mode 100644 test/generators/man/Oxcaml_impl.Multiple_include_functors.3o create mode 100644 test/generators/man/Oxcaml_impl.Multiple_include_functors.First.3o create mode 100644 test/generators/man/Oxcaml_impl.Multiple_include_functors.Second.3o create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-X.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-S.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_not_last-Make-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_not_last-Make.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_not_last.md create mode 100644 test/generators/markdown/Oxcaml-Multiple_include_functors-First-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-Multiple_include_functors-First.md create mode 100644 test/generators/markdown/Oxcaml-Multiple_include_functors-Second-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml-Multiple_include_functors-Second.md create mode 100644 test/generators/markdown/Oxcaml-Multiple_include_functors.md create mode 100644 test/generators/markdown/Oxcaml_impl-Anonymous_functor.md create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor_not_last-Make.md create mode 100644 test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md create mode 100644 test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First.md create mode 100644 test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md create mode 100644 test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second.md create mode 100644 test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md diff --git a/test/generators/cases/oxcaml.mli b/test/generators/cases/oxcaml.mli index a3dd537cd8..5c82e6fea9 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -539,24 +539,72 @@ module Include_functor : sig include functor module type of Make end +module Include_functor_argument_shapes : sig +(** Everything the expansion of the functor can inherit from its argument: + types, including parameterised and anonymously parameterised ones, + submodules, and module types. *) + module type Arg = sig + type t + type 'a p + type _ anon + module X : sig type v end + module type S + end + + module Make (T : Arg) : sig + type included = T.t + (** No parameters, so the alias odoc puts in the synthetic module is a bare + [type t = t]. *) + + type applied = int T.p + (** A named parameter, which the alias threads through as + [type 'a p = 'a p]. *) + + type anonymous = bool T.anon + (** An anonymous parameter: [_] gives the alias no name to mention on the + right, so one is invented, as [type 'a0 anon = 'a0 anon]. *) + + type from_module = T.X.v + (** Reached through a submodule of the argument, aliased as + [module X = X]. *) + + module type Reexported = T.S + (** A module type of the argument, aliased as a path to it. *) + end + + type t + type 'a p + type _ anon + module X : sig type v end + module type S = sig type u end + + include functor module type of Make +end + module Include_functor_desugared : sig +(** This module is the desugared version of {!Include_functor}: the synthetic + module aliases the preceding items rather than copying them, so that the + types the functor inherits from its argument resolve back to them. *) module Make (T : sig type t end) : sig type included = T.t end + type t + module DUMMY__ : sig - type t + type nonrec t = t end - include module type of DUMMY__ include module type of Make(DUMMY__) end module Include_functor_named_type_desugared : sig -(** This is a module where the functor is named and then included. *) - module type MakeType = (_ : sig type t end) -> sig type included end +(** This is the desugared version of {!Include_functor_named_type}. *) + module type MakeType = (X : sig type t end) -> sig type included = X.t end + + type t + module DUMMY__ : sig - type t + type nonrec t = t end - include module type of DUMMY__ module STRUCT__MakeType : MakeType include module type of STRUCT__MakeType(DUMMY__) @@ -564,7 +612,7 @@ end module Include_functor_named_type : sig (** This is a module where the functor is named and then included. *) - module type MakeType = (_ : sig type t end) -> sig type included end + module type MakeType = (X : sig type t end) -> sig type included = X.t end type t include functor MakeType end @@ -593,3 +641,27 @@ module Anonymous_functor_desugared : sig include module type of (functor (T : sig type t end) -> struct type included end)(DUMMY__) end +module Multiple_include_functors : sig +(** Two [include functor]s in the same signature, with an item defined between + them. *) + module First (T : sig type t end) : sig type first = T.t end + + module Second (T : sig type t type first type between end) : sig + type second = T.first + type third = T.between + end + + type t + include functor module type of First + type between + include functor module type of Second +end + +module Include_functor_not_last : sig +(** An [include functor] that is not the last item of the signature. *) + module Make (T : sig type t end) : sig type included = T.t end + + type t + include functor module type of Make + type after +end diff --git a/test/generators/cases/oxcaml_impl.ml b/test/generators/cases/oxcaml_impl.ml index 9ddce9f1cc..4789f12542 100644 --- a/test/generators/cases/oxcaml_impl.ml +++ b/test/generators/cases/oxcaml_impl.ml @@ -63,19 +63,21 @@ let mode_multi : string @ local once -> string @ local once = fun x -> x (** {1 Include functor on structures} *) module Include_functor = struct -(** This module demonstrates the [include functor] functionality *) - module Make (T : sig type t end) = struct type included end +(** This module demonstrates the [include functor] functionality. [Make] uses + its argument, so [included] has to come out equal to [t] rather than + abstract. *) + module Make (T : sig type t end) = struct type included = T.t end type t include functor Make end module Include_functor_desugared = struct (** This module is the desugared version from above *) - module Make (T : sig type t end) = struct type included end + module Make (T : sig type t end) = struct type included = T.t end + type t module DUMMY__ = struct - type t + type nonrec t = t end - include DUMMY__ include Make(DUMMY__) end @@ -89,3 +91,36 @@ module Resolve_functor = struct include functor F end end + +module Multiple_include_functors = struct +(** Two [include functor]s in the same structure, with an item defined between + them. *) + module First (T : sig type t end) = struct type first = T.t end + + module Second (T : sig type t type first type between end) = struct + type second = T.first + type third = T.between + end + + type t + include functor First + type between + include functor Second +end + +module Include_functor_not_last = struct +(** An [include functor] that is not the last item of the structure. *) + module Make (T : sig type t end) = struct type included = T.t end + + type t + include functor Make + type after = string +end + +module Anonymous_functor = struct +(** The functor is defined inline, so there is no path for odoc to apply: it + has to bind the functor to a module first, as it does for every + [include functor] in a signature. *) + type t + include functor (functor (T : sig type t end) -> struct type included = T.t end) +end diff --git a/test/generators/html/Oxcaml-Anonymous_functor.html b/test/generators/html/Oxcaml-Anonymous_functor.html index 4a3b511670..b42ee26901 100644 --- a/test/generators/html/Oxcaml-Anonymous_functor.html +++ b/test/generators/html/Oxcaml-Anonymous_functor.html @@ -32,8 +32,8 @@

    Module Oxcaml.Anonymous_functor

    include functor functor ( - T - : sig ... + T + : sig ... end) -> sig ... diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html new file mode 100644 index 0000000000..978317b605 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html @@ -0,0 +1,34 @@ + + + X (Oxcaml.Include_functor_argument_shapes.Make.T.X) + + + + + + + + +

    Module T.X

    +
    +
    +
    +
    + + type v +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html new file mode 100644 index 0000000000..2bcd2843a9 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html @@ -0,0 +1,73 @@ + + + T (Oxcaml.Include_functor_argument_shapes.Make.T) + + + + + + + + +
    +

    Parameter Make.T

    +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + type 'a p + +
    +
    +
    +
    + + type _ anon + +
    +
    +
    +
    + + + module + + X + + + : sig ... + end + + +
    +
    +
    +
    + + + module + type S + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html new file mode 100644 index 0000000000..dbadd7b1d3 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html @@ -0,0 +1,150 @@ + + + Make (Oxcaml.Include_functor_argument_shapes.Make) + + + + + + + + +
    +

    Module Include_functor_argument_shapes.Make +

    +
    +
    + +
    +
    +

    Parameters +

    +
    +
    + + module + + + T + + + : + + Arg + + + +
    +
    +

    Signature

    +
    +
    + + type included + = + T.t + + + +
    +
    +

    No parameters, so the alias odoc puts in the synthetic module + is a bare type t = t. +

    +
    +
    +
    +
    + + type applied + = + int + T.p + + + + +
    +
    +

    A named parameter, which the alias threads through as + type 'a p = 'a p. +

    +
    +
    +
    +
    + + type anonymous + = + bool + T.anon + + + + +
    +
    +

    An anonymous parameter: _ gives the alias no name + to mention on the right, so one is invented, as + type 'a0 anon = 'a0 anon. +

    +
    +
    +
    +
    + + type from_module + = + T.X.v + + + +
    +
    +

    Reached through a submodule of the argument, aliased as + module X = X. +

    +
    +
    +
    +
    + + + module + type Reexported + + = + T.S + + + +
    +
    +

    A module type of the argument, aliased as a path to it.

    +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-X.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-X.html new file mode 100644 index 0000000000..e70cb945ae --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-X.html @@ -0,0 +1,32 @@ + + + X (Oxcaml.Include_functor_argument_shapes.X) + + + + + + + + +
    +

    Module Include_functor_argument_shapes.X +

    +
    +
    +
    +
    + + type v +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html new file mode 100644 index 0000000000..2e84724276 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html @@ -0,0 +1,33 @@ + + + X (Oxcaml.Include_functor_argument_shapes.Arg.X) + + + + + + + + +
    +

    Module Arg.X

    +
    +
    +
    +
    + + type v +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html new file mode 100644 index 0000000000..4719ea11f2 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html @@ -0,0 +1,77 @@ + + + Arg (Oxcaml.Include_functor_argument_shapes.Arg) + + + + + + + + +
    +

    Module type + Include_functor_argument_shapes.Arg +

    +

    Everything the expansion of the functor can inherit from its argument: + types, including parameterised and anonymously parameterised ones, + submodules, and module types. +

    +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + type 'a p + +
    +
    +
    +
    + + type _ anon + +
    +
    +
    +
    + + + module + + X + + + : sig ... + end + + +
    +
    +
    +
    + + + module + type S + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html new file mode 100644 index 0000000000..7740b73965 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html @@ -0,0 +1,34 @@ + + + + Reexported (Oxcaml.Include_functor_argument_shapes.Reexported) + + + + + + + + +
    +

    Module type + Include_functor_argument_shapes.Reexported +

    A module type of the argument, aliased as a path to it.

    +
    +
    +
    +
    + + type u +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-S.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-S.html new file mode 100644 index 0000000000..054e43393a --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-S.html @@ -0,0 +1,33 @@ + + + S (Oxcaml.Include_functor_argument_shapes.S) + + + + + + + + +
    +

    Module type + Include_functor_argument_shapes.S +

    +
    +
    +
    +
    + + type u +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html new file mode 100644 index 0000000000..59fd2847ee --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html @@ -0,0 +1,194 @@ + + + + + Include_functor_argument_shapes (Oxcaml.Include_functor_argument_shapes) + + + + + + + + +
    +

    Module + Oxcaml.Include_functor_argument_shapes +

    +
    +
    +
    +
    + + + module + type + + Arg + + + = sig ... + end + + +
    +
    +

    Everything the expansion of the functor can inherit from its + argument: types, including parameterised and anonymously parameterised + ones, submodules, and module types. +

    +
    +
    +
    +
    + + + module + Make + + ( + + T + : + + Arg + ) : sig ... + end + + +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + type 'a p + +
    +
    +
    +
    + + type _ anon + +
    +
    +
    +
    + + + module + X + + : sig ... + end + + +
    +
    +
    +
    + + + module + type + S + + + = sig ... + end + + +
    +
    +
    +
    + + + include functor + module type + of + Make + + + +
    +
    + + type included +
    +
    +

    No parameters, so the alias odoc puts in the synthetic module + is a bare type t = t. +

    +
    +
    +
    +
    + + type applied +
    +
    +

    A named parameter, which the alias threads through as + type 'a p = 'a p. +

    +
    +
    +
    +
    + + type anonymous +
    +
    +

    An anonymous parameter: _ gives the alias no name + to mention on the right, so one is invented, as + type 'a0 anon = 'a0 anon. +

    +
    +
    +
    +
    + + type from_module + +
    +
    +

    Reached through a submodule of the argument, aliased as + module X = X. +

    +
    +
    +
    +
    + + + module + type + Reexported + + + = sig ... + end + + +
    +
    +

    A module type of the argument, aliased as a path to it.

    +
    +
    +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_desugared-Make.html b/test/generators/html/Oxcaml-Include_functor_desugared-Make.html index 9994a824d1..f18f65ab5a 100644 --- a/test/generators/html/Oxcaml-Include_functor_desugared-Make.html +++ b/test/generators/html/Oxcaml-Include_functor_desugared-Make.html @@ -17,6 +17,12 @@

    Module Include_functor_desugared.Make

    +

    This module is the desugared version of + Include_functor + : the synthetic module aliases the preceding items rather than copying + them, so that the types the functor inherits from its argument resolve + back to them. +

    +
    +

    This module is the desugared version of + Include_functor + : the synthetic module aliases the preceding items rather than + copying them, so that the types the functor inherits from its argument + resolve back to them. +

    +
    @@ -51,7 +59,9 @@

    Module Oxcaml.Include_functor_desugared

    - type included + type included + = t +
    diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html new file mode 100644 index 0000000000..697c474b77 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html @@ -0,0 +1,34 @@ + + + X (Oxcaml.Include_functor_named_type.MakeType.X) + + + + + + + + +
    +

    Parameter MakeType.X

    +
    +
    +
    +
    + + type t +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType.html b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType.html index 9d1e9154b7..d827a15d13 100644 --- a/test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType.html +++ b/test/generators/html/Oxcaml-Include_functor_named_type-module-type-MakeType.html @@ -32,13 +32,13 @@

    Module type

    Parameters

    -
    - +
    + module _ + href="Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html" + >X : sig ... @@ -51,7 +51,14 @@

    Signature

    - type included + type included + = + X.t + + +
    diff --git a/test/generators/html/Oxcaml-Include_functor_named_type.html b/test/generators/html/Oxcaml-Include_functor_named_type.html index 40746997c9..794abf1df3 100644 --- a/test/generators/html/Oxcaml-Include_functor_named_type.html +++ b/test/generators/html/Oxcaml-Include_functor_named_type.html @@ -31,8 +31,8 @@

    Module Oxcaml.Include_functor_named_type = functor ( _ + href="Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html" + >X : sig ... end) -> diff --git a/test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html b/test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html new file mode 100644 index 0000000000..b082b8ca2d --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html @@ -0,0 +1,38 @@ + + + + X (Oxcaml.Include_functor_named_type_desugared.MakeType.X) + + + + + + + + +
    +

    Parameter MakeType.X

    +
    +
    +
    +
    + + type t +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html b/test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html index 47ead0f0d2..9187fb35fa 100644 --- a/test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html +++ b/test/generators/html/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html @@ -20,7 +20,12 @@

    Module type Include_functor_named_type_desugared.MakeType -

    This is a module where the functor is named and then included.

    +

    +

    This is the desugared version of + + Include_functor_named_type + . +

    +
    +
    + + + module + + Include_functor_argument_shapes + + + : sig ... + end + + +
    +
    @@ -2377,6 +2393,36 @@

    +
    +
    + + + module + + Multiple_include_functors + + + : sig ... + end + + +
    +
    +
    +
    + + + module + + Include_functor_not_last + + + : sig ... + end + + +
    +
    diff --git a/test/generators/html/Oxcaml_impl-Anonymous_functor.html b/test/generators/html/Oxcaml_impl-Anonymous_functor.html new file mode 100644 index 0000000000..06a4c347c6 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Anonymous_functor.html @@ -0,0 +1,41 @@ + + + Anonymous_functor (Oxcaml_impl.Anonymous_functor) + + + + + + + + +
    +

    Module Oxcaml_impl.Anonymous_functor

    +
    +
    +
    +
    + + type t +
    +
    +

    The functor is defined inline, so there is no path for odoc to + apply: it has to bind the functor to a module first, as it does + for every include functor in a signature. +

    +
    +
    +
    +
    + + type included + = t + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Include_functor-Make.html b/test/generators/html/Oxcaml_impl-Include_functor-Make.html index 10af9d155b..037ce33f5a 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor-Make.html +++ b/test/generators/html/Oxcaml_impl-Include_functor-Make.html @@ -16,7 +16,10 @@

    Module Include_functor.Make

    -

    This module demonstrates the include functor functionality +

    This module demonstrates the include functor + functionality. Make uses its argument, so + included has to come out equal to t rather + than abstract.

    @@ -46,7 +49,13 @@

    Signature

    - type included + type included + = + + T.t + + +
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor.html b/test/generators/html/Oxcaml_impl-Include_functor.html index 99fec2ddde..68e9061edc 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor.html +++ b/test/generators/html/Oxcaml_impl-Include_functor.html @@ -33,7 +33,9 @@

    Module Oxcaml_impl.Include_functor

    This module demonstrates the include functor - functionality + functionality. Make uses its argument, so + included has to come out equal to t rather + than abstract.

    diff --git a/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html b/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html index 440e823d37..6ceb4a91b6 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html +++ b/test/generators/html/Oxcaml_impl-Include_functor_desugared-Make.html @@ -49,7 +49,14 @@

    Signature

    - type included + type included + = + T.t + + +
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor_desugared.html b/test/generators/html/Oxcaml_impl-Include_functor_desugared.html index 6143a029c0..d63261b967 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor_desugared.html +++ b/test/generators/html/Oxcaml_impl-Include_functor_desugared.html @@ -58,12 +58,7 @@

    Module Oxcaml_impl.Include_functor_desugared
    type included - = - - Make(DUMMY__).included - - + = t

    diff --git a/test/generators/html/Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html b/test/generators/html/Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html new file mode 100644 index 0000000000..766bf59fe7 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html @@ -0,0 +1,33 @@ + + + T (Oxcaml_impl.Include_functor_not_last.Make.T) + + + + + + + + +
    +

    Parameter Make.T

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

    Module Include_functor_not_last.Make

    +

    An include functor that is not the last item of the + structure. +

    +
    +
    + +
    +
    +

    Parameters +

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

    Signature

    +
    +
    + + type included + = + T.t + + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Include_functor_not_last.html b/test/generators/html/Oxcaml_impl-Include_functor_not_last.html new file mode 100644 index 0000000000..bbd0deeedb --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Include_functor_not_last.html @@ -0,0 +1,60 @@ + + + + Include_functor_not_last (Oxcaml_impl.Include_functor_not_last) + + + + + + + + +
    +

    Module Oxcaml_impl.Include_functor_not_last +

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

    An include functor that is not the last item of + the structure. +

    +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + type after + = string + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html b/test/generators/html/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html new file mode 100644 index 0000000000..e49035ad12 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html @@ -0,0 +1,33 @@ + + + T (Oxcaml_impl.Multiple_include_functors.First.T) + + + + + + + + +
    +

    Parameter First.T

    +
    +
    +
    +
    + + type t +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Multiple_include_functors-First.html b/test/generators/html/Oxcaml_impl-Multiple_include_functors-First.html new file mode 100644 index 0000000000..1aa9b69939 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Multiple_include_functors-First.html @@ -0,0 +1,67 @@ + + + First (Oxcaml_impl.Multiple_include_functors.First) + + + + + + + + +
    +

    Module Multiple_include_functors.First

    +

    Two include functors in the same structure, with an + item defined between them. +

    +
    +
    + +
    +
    +

    Parameters +

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

    Signature

    +
    +
    + + type first + = + T.t + + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html b/test/generators/html/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html new file mode 100644 index 0000000000..4df3209f1a --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html @@ -0,0 +1,45 @@ + + + T (Oxcaml_impl.Multiple_include_functors.Second.T) + + + + + + + + +
    +

    Parameter Second.T

    +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + type first +
    +
    +
    +
    + + type between +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Multiple_include_functors-Second.html b/test/generators/html/Oxcaml_impl-Multiple_include_functors-Second.html new file mode 100644 index 0000000000..c462a9f8e8 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Multiple_include_functors-Second.html @@ -0,0 +1,77 @@ + + + Second (Oxcaml_impl.Multiple_include_functors.Second) + + + + + + + + +
    +

    Module Multiple_include_functors.Second

    +
    +
    + +
    +
    +

    Parameters +

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

    Signature

    +
    +
    + + type second + = + T.first + + + +
    +
    +
    +
    + + type third + = + T.between + + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl-Multiple_include_functors.html b/test/generators/html/Oxcaml_impl-Multiple_include_functors.html new file mode 100644 index 0000000000..bb639f6187 --- /dev/null +++ b/test/generators/html/Oxcaml_impl-Multiple_include_functors.html @@ -0,0 +1,103 @@ + + + + Multiple_include_functors (Oxcaml_impl.Multiple_include_functors) + + + + + + + + +
    +

    Module Oxcaml_impl.Multiple_include_functors +

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

    Two include functors in the same structure, with + an item defined between them. +

    +
    +
    +
    +
    + + + module + Second + + ( + + T + : sig ... + end) : sig + ... end + + +
    +
    +
    +
    + + type t +
    +
    +
    +
    + + type between +
    +
    +
    +
    + + + include functor + Second + + + + +
    +
    + + type second + = BODY__15.first + +
    +
    +
    +
    + + type third +
    +
    +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml_impl.html b/test/generators/html/Oxcaml_impl.html index c2a80228d0..4f7d1fbf25 100644 --- a/test/generators/html/Oxcaml_impl.html +++ b/test/generators/html/Oxcaml_impl.html @@ -367,6 +367,49 @@

    +
    +
    + + + module + + Multiple_include_functors + + + : sig ... + end + + +
    +
    +
    +
    + + + module + + Include_functor_not_last + + + : sig ... + end + + +
    +
    +
    +
    + + + module + Anonymous_functor + + : sig ... + end + + +
    +
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index 8fd752f548..1558321adc 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -15,17 +15,34 @@ 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_argument_shapes.html +Oxcaml-Include_functor_argument_shapes-module-type-Arg.html +Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html +Oxcaml-Include_functor_argument_shapes-Make.html +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html +Oxcaml-Include_functor_argument_shapes-X.html +Oxcaml-Include_functor_argument_shapes-module-type-S.html +Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html Oxcaml-Include_functor_desugared.html Oxcaml-Include_functor_desugared-Make.html Oxcaml-Include_functor_desugared-Make-argument-1-T.html Oxcaml-Include_functor_named_type_desugared.html Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html -Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.html +Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html Oxcaml-Include_functor_named_type.html Oxcaml-Include_functor_named_type-module-type-MakeType.html -Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html +Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html Oxcaml-Include_functor_inline.html Oxcaml-Include_functor_inline-module-type-Make.html Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html Oxcaml-Anonymous_functor.html Oxcaml-Anonymous_functor_desugared.html +Oxcaml-Multiple_include_functors.html +Oxcaml-Multiple_include_functors-First.html +Oxcaml-Multiple_include_functors-First-argument-1-T.html +Oxcaml-Multiple_include_functors-Second.html +Oxcaml-Multiple_include_functors-Second-argument-1-T.html +Oxcaml-Include_functor_not_last.html +Oxcaml-Include_functor_not_last-Make.html +Oxcaml-Include_functor_not_last-Make-argument-1-T.html diff --git a/test/generators/html/oxcaml_impl.targets b/test/generators/html/oxcaml_impl.targets index f6f2b8cd6c..1489a68778 100644 --- a/test/generators/html/oxcaml_impl.targets +++ b/test/generators/html/oxcaml_impl.targets @@ -11,3 +11,12 @@ Oxcaml_impl-Resolve_functor.html Oxcaml_impl-Resolve_functor-F.html Oxcaml_impl-Resolve_functor-F-argument-1-I.html Oxcaml_impl-Resolve_functor-M.html +Oxcaml_impl-Multiple_include_functors.html +Oxcaml_impl-Multiple_include_functors-First.html +Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html +Oxcaml_impl-Multiple_include_functors-Second.html +Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html +Oxcaml_impl-Include_functor_not_last.html +Oxcaml_impl-Include_functor_not_last-Make.html +Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html +Oxcaml_impl-Anonymous_functor.html diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index adc1c2da69..d1e861c498 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -410,30 +410,65 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \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_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_desugared--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_desugared-Make-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ -\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\label{Oxcaml--module-Include_functor_argument_shapes}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}argument\_\allowbreak{}shapes}}}\label{Oxcaml-Include_functor_argument_shapes}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_argument_shapes--module-type-Arg}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg]{\ocamlinlinecode{Arg}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-p}\ocamlcodefragment{\ocamltag{keyword}{type} 'a p}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-anon}\ocamlcodefragment{\ocamltag{keyword}{type} \_\allowbreak{} anon}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--module-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg-X]{\ocamlinlinecode{X}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg-X--type-v}\ocamlcodefragment{\ocamltag{keyword}{type} v}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Include_functor_named_type_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_named_type_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--parameters_5}}% -\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--module-type-S}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} S}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_argument_shapes--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_argument_shapes-Make-argument-1-T]{\ocamlinlinecode{T}} : \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg]{\ocamlinlinecode{Arg}}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ +\label{Oxcaml-Include_functor_argument_shapes--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml-Include_functor_argument_shapes--type-p}\ocamlcodefragment{\ocamltag{keyword}{type} 'a p}\\ +\label{Oxcaml-Include_functor_argument_shapes--type-anon}\ocamlcodefragment{\ocamltag{keyword}{type} \_\allowbreak{} anon}\\ +\label{Oxcaml-Include_functor_argument_shapes--module-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes-X]{\ocamlinlinecode{X}}}\label{Oxcaml-Include_functor_argument_shapes-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-X--type-v}\ocamlcodefragment{\ocamltag{keyword}{type} v}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--signature_5}}% -\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\label{Oxcaml-Include_functor_argument_shapes--module-type-S}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-S]{\ocamlinlinecode{S}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-S}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-S--type-u}\ocamlcodefragment{\ocamltag{keyword}{type} u}\\ \end{ocamlindent}% -\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor_argument_shapes-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_argument_shapes--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\begin{ocamlindent}No parameters, so the alias odoc puts in the synthetic module is a bare \ocamlinlinecode{type t = t}.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_argument_shapes--type-applied}\ocamlcodefragment{\ocamltag{keyword}{type} applied}\begin{ocamlindent}A named parameter, which the alias threads through as \ocamlinlinecode{type 'a p = 'a p}.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_argument_shapes--type-anonymous}\ocamlcodefragment{\ocamltag{keyword}{type} anonymous}\begin{ocamlindent}An anonymous parameter: \ocamlinlinecode{\_\allowbreak{}} gives the alias no name to mention on the right, so one is invented, as \ocamlinlinecode{type 'a0 anon = 'a0 anon}.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_argument_shapes--type-from_module}\ocamlcodefragment{\ocamltag{keyword}{type} from\_\allowbreak{}module}\begin{ocamlindent}Reached through a submodule of the argument, aliased as \ocamlinlinecode{module X = X}.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_argument_shapes--module-type-Reexported}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Reexported]{\ocamlinlinecode{Reexported}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Reexported}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Reexported--type-u}\ocamlcodefragment{\ocamltag{keyword}{type} u}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}A module type of the argument, aliased as a path to it.\end{ocamlindent}% +\medbreak +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml--module-Include_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_desugared--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_desugared-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 is the desugared version of \hyperref[Oxcaml-Include_functor]{\ocamlinlinecode{\ocamlinlinecode{Include\_\allowbreak{}functor}}[p\pageref*{Oxcaml-Include_functor}]}: the synthetic module aliases the preceding items rather than copying them, so that the types the functor inherits from its argument resolve back to them.\end{ocamlindent}% \medbreak -\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_named_type_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_named_type_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\label{Oxcaml-Include_functor_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_desugared--type-t]{\ocamlinlinecode{t}}}\\ \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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_6}}% -\label{Oxcaml-Include_functor_named_type-module-type-MakeType--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml--module-Include_functor_named_type_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_named_type_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--parameters_6}}% +\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--argument-1-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X]{\ocamlinlinecode{X}}}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_6}}% -\label{Oxcaml-Include_functor_named_type-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--signature_6}}% +\label{Oxcaml-Include_functor_named_type_desugared-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X--type-t]{\ocamlinlinecode{X.\allowbreak{}t}}}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is the desugared version of \hyperref[Oxcaml-Include_functor_named_type]{\ocamlinlinecode{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}named\_\allowbreak{}type}}[p\pageref*{Oxcaml-Include_functor_named_type}]}.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_named_type_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_named_type_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_named_type_desugared--type-t]{\ocamlinlinecode{t}}}\\ +\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_7}}% +\label{Oxcaml-Include_functor_named_type-module-type-MakeType--argument-1-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X]{\ocamlinlinecode{X}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_7}}% +\label{Oxcaml-Include_functor_named_type-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X--type-t]{\ocamlinlinecode{X.\allowbreak{}t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% \medbreak @@ -441,11 +476,11 @@ \subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeTy \ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_7}}% +\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_8}}% \label{Oxcaml-Include_functor_inline-module-type-Make--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-module-type-Make-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_7}}% +\subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_8}}% \label{Oxcaml-Include_functor_inline-module-type-Make--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a test case where the functor is named and included inline\end{ocamlindent}% @@ -456,13 +491,28 @@ \subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--sign \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}In this test case the functor is defined inline\end{ocamlindent}% \medbreak -\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml-Anonymous_functor-include10_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml-Anonymous_functor-include9_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Anonymous_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor_desugared]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml-Anonymous_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Anonymous_functor_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml--module-Multiple_include_functors}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors]{\ocamlinlinecode{Multiple\_\allowbreak{}include\_\allowbreak{}functors}}}\label{Oxcaml-Multiple_include_functors}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Multiple_include_functors--module-First}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors-First]{\ocamlinlinecode{First}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Multiple_include_functors-First-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}Two \ocamlinlinecode{include functor}s in the same signature, with an item defined between them.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Multiple_include_functors--module-Second}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Multiple_include_functors-Second-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ +\label{Oxcaml-Multiple_include_functors--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml-Multiple_include_functors--type-between}\ocamlcodefragment{\ocamltag{keyword}{type} between}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}49.\allowbreak{}first}}}\\ +\label{Oxcaml-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml--module-Include_functor_not_last}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_not_last]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}not\_\allowbreak{}last}}}\label{Oxcaml-Include_functor_not_last}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_not_last--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_not_last-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}An \ocamlinlinecode{include functor} that is not the last item of the signature.\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_not_last--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml-Include_functor_not_last--type-after}\ocamlcodefragment{\ocamltag{keyword}{type} after}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ \input{Oxcaml.F_with.tex} \input{Oxcaml.X_with.tex} diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index 167470e7eb..6bb665f28b 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -45,7 +45,7 @@ \subsubsection{Modes on values\label{Oxcaml_impl--modes-on-values}}% \label{Oxcaml_impl--val-mode_multi}\ocamlcodefragment{\ocamltag{keyword}{val} mode\_\allowbreak{}multi : string @ local once \ocamltag{arrow}{$\rightarrow$} string @ local once}\begin{ocamlindent}Multiple modes on argument and return.\end{ocamlindent}% \medbreak \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on-structures}}% -\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\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 demonstrates the \ocamlinlinecode{include functor} functionality\end{ocamlindent}% +\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\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 demonstrates the \ocamlinlinecode{include functor} functionality. \ocamlinlinecode{Make} uses its argument, so \ocamlinlinecode{included} has to come out equal to \ocamlinlinecode{t} rather than abstract.\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}\\ @@ -53,8 +53,8 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Include_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml_impl-Include_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Include_functor_desugared--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_desugared-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Include_functor_desugared-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 is the desugared version from above\end{ocamlindent}% \medbreak -\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml_impl-Include_functor_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml_impl-Include_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-Include_functor_desugared-Make--type-included]{\ocamlinlinecode{Make(DUMMY\_\allowbreak{}\_\allowbreak{}).\allowbreak{}included}}}\\ +\label{Oxcaml_impl-Include_functor_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml_impl-Include_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-Include_functor_desugared--type-t]{\ocamlinlinecode{t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Resolve_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor]{\ocamlinlinecode{Resolve\_\allowbreak{}functor}}}\label{Oxcaml_impl-Resolve_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor--module-F}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Resolve_functor-F-argument-1-I]{\ocamlinlinecode{I}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ @@ -64,5 +64,25 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml_impl--module-Multiple_include_functors}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors]{\ocamlinlinecode{Multiple\_\allowbreak{}include\_\allowbreak{}functors}}}\label{Oxcaml_impl-Multiple_include_functors}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml_impl-Multiple_include_functors--module-First}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors-First]{\ocamlinlinecode{First}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Multiple_include_functors-First-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}Two \ocamlinlinecode{include functor}s in the same structure, with an item defined between them.\end{ocamlindent}% +\medbreak +\label{Oxcaml_impl-Multiple_include_functors--module-Second}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Multiple_include_functors-Second-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ +\label{Oxcaml_impl-Multiple_include_functors--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml_impl-Multiple_include_functors--type-between}\ocamlcodefragment{\ocamltag{keyword}{type} between}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml_impl-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}15.\allowbreak{}first}}}\\ +\label{Oxcaml_impl-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml_impl--module-Include_functor_not_last}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_not_last]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}not\_\allowbreak{}last}}}\label{Oxcaml_impl-Include_functor_not_last}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Include_functor_not_last--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Include_functor_not_last-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}An \ocamlinlinecode{include functor} that is not the last item of the structure.\end{ocamlindent}% +\medbreak +\label{Oxcaml_impl-Include_functor_not_last--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml_impl-Include_functor_not_last--type-after}\ocamlcodefragment{\ocamltag{keyword}{type} after = string}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\label{Oxcaml_impl--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml_impl-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every \ocamlinlinecode{include functor} in a signature.\end{ocamlindent}% +\medbreak +\label{Oxcaml_impl-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-Anonymous_functor--type-t]{\ocamlinlinecode{t}}}\\ +\end{ocamlindent}% +\ocamlcodefragment{\ocamltag{keyword}{end}}\\ diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index 711a493c03..b22b3eba26 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11964,20 +11964,37 @@ Oxcaml-Include_functor.html.gen Oxcaml-Include_functor-Make.html.gen Oxcaml-Include_functor-Make-argument-1-T.html.gen + Oxcaml-Include_functor_argument_shapes.html.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg.html.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html.gen + Oxcaml-Include_functor_argument_shapes-Make.html.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html.gen + Oxcaml-Include_functor_argument_shapes-X.html.gen + Oxcaml-Include_functor_argument_shapes-module-type-S.html.gen + Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html.gen Oxcaml-Include_functor_desugared.html.gen Oxcaml-Include_functor_desugared-Make.html.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.html.gen Oxcaml-Include_functor_named_type_desugared.html.gen Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.html.gen - Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.html.gen + Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html.gen Oxcaml-Include_functor_named_type.html.gen Oxcaml-Include_functor_named_type-module-type-MakeType.html.gen - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html.gen + Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html.gen Oxcaml-Include_functor_inline.html.gen Oxcaml-Include_functor_inline-module-type-Make.html.gen Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.html.gen Oxcaml-Anonymous_functor.html.gen - Oxcaml-Anonymous_functor_desugared.html.gen) + Oxcaml-Anonymous_functor_desugared.html.gen + Oxcaml-Multiple_include_functors.html.gen + Oxcaml-Multiple_include_functors-First.html.gen + Oxcaml-Multiple_include_functors-First-argument-1-T.html.gen + Oxcaml-Multiple_include_functors-Second.html.gen + Oxcaml-Multiple_include_functors-Second-argument-1-T.html.gen + Oxcaml-Include_functor_not_last.html.gen + Oxcaml-Include_functor_not_last-Make.html.gen + Oxcaml-Include_functor_not_last-Make-argument-1-T.html.gen) (package odoc) (action (run @@ -12105,6 +12122,78 @@ 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_argument_shapes.html + Oxcaml-Include_functor_argument_shapes.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg.html + Oxcaml-Include_functor_argument_shapes-module-type-Arg.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html + Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make.html + Oxcaml-Include_functor_argument_shapes-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-X.html + Oxcaml-Include_functor_argument_shapes-X.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-S.html + Oxcaml-Include_functor_argument_shapes-module-type-S.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html + Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12150,8 +12239,8 @@ (package odoc) (action (diff - Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.html - Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.html.gen)) + Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html + Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.html.gen)) (enabled_if %{ocaml-config:ox})) (rule (alias runtest) @@ -12174,8 +12263,8 @@ (package odoc) (action (diff - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.html.gen)) + Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html + Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.html.gen)) (enabled_if %{ocaml-config:ox})) (rule (alias runtest) @@ -12214,6 +12303,70 @@ (diff Oxcaml-Anonymous_functor_desugared.html Oxcaml-Anonymous_functor_desugared.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors.html + Oxcaml-Multiple_include_functors.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-First.html + Oxcaml-Multiple_include_functors-First.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-First-argument-1-T.html + Oxcaml-Multiple_include_functors-First-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-Second.html + Oxcaml-Multiple_include_functors-Second.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-Second-argument-1-T.html + Oxcaml-Multiple_include_functors-Second-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_not_last.html + Oxcaml-Include_functor_not_last.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_not_last-Make.html + Oxcaml-Include_functor_not_last-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_not_last-Make-argument-1-T.html + Oxcaml-Include_functor_not_last-Make-argument-1-T.html.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12303,13 +12456,21 @@ Oxcaml.No_include_functor.T.3o.gen Oxcaml.Include_functor.3o.gen Oxcaml.Include_functor.Make.3o.gen + Oxcaml.Include_functor_argument_shapes.3o.gen + Oxcaml.Include_functor_argument_shapes.Make.3o.gen + Oxcaml.Include_functor_argument_shapes.X.3o.gen Oxcaml.Include_functor_desugared.3o.gen Oxcaml.Include_functor_desugared.Make.3o.gen Oxcaml.Include_functor_named_type_desugared.3o.gen Oxcaml.Include_functor_named_type.3o.gen Oxcaml.Include_functor_inline.3o.gen Oxcaml.Anonymous_functor.3o.gen - Oxcaml.Anonymous_functor_desugared.3o.gen) + Oxcaml.Anonymous_functor_desugared.3o.gen + Oxcaml.Multiple_include_functors.3o.gen + Oxcaml.Multiple_include_functors.First.3o.gen + Oxcaml.Multiple_include_functors.Second.3o.gen + Oxcaml.Include_functor_not_last.3o.gen + Oxcaml.Include_functor_not_last.Make.3o.gen) (package odoc) (action (run odoc man-generate -o . --extra-suffix gen %{dep:../oxcaml.odocl})) @@ -12388,6 +12549,30 @@ (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_argument_shapes.3o + Oxcaml.Include_functor_argument_shapes.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.Make.3o + Oxcaml.Include_functor_argument_shapes.Make.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.X.3o + Oxcaml.Include_functor_argument_shapes.X.3o.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12441,6 +12626,46 @@ (diff Oxcaml.Anonymous_functor_desugared.3o Oxcaml.Anonymous_functor_desugared.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Multiple_include_functors.3o + Oxcaml.Multiple_include_functors.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Multiple_include_functors.First.3o + Oxcaml.Multiple_include_functors.First.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Multiple_include_functors.Second.3o + Oxcaml.Multiple_include_functors.Second.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_not_last.3o + Oxcaml.Include_functor_not_last.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_not_last.Make.3o + Oxcaml.Include_functor_not_last.Make.3o.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12481,20 +12706,37 @@ Oxcaml-Include_functor.md.gen Oxcaml-Include_functor-Make.md.gen Oxcaml-Include_functor-Make-argument-1-T.md.gen + Oxcaml-Include_functor_argument_shapes.md.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg.md.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md.gen + Oxcaml-Include_functor_argument_shapes-Make.md.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md.gen + Oxcaml-Include_functor_argument_shapes-X.md.gen + Oxcaml-Include_functor_argument_shapes-module-type-S.md.gen + Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md.gen Oxcaml-Include_functor_desugared.md.gen Oxcaml-Include_functor_desugared-Make.md.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.md.gen Oxcaml-Include_functor_named_type_desugared.md.gen Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md.gen - Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.md.gen + Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md.gen Oxcaml-Include_functor_named_type.md.gen Oxcaml-Include_functor_named_type-module-type-MakeType.md.gen - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md.gen + Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md.gen Oxcaml-Include_functor_inline.md.gen Oxcaml-Include_functor_inline-module-type-Make.md.gen Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md.gen Oxcaml-Anonymous_functor.md.gen - Oxcaml-Anonymous_functor_desugared.md.gen) + Oxcaml-Anonymous_functor_desugared.md.gen + Oxcaml-Multiple_include_functors.md.gen + Oxcaml-Multiple_include_functors-First.md.gen + Oxcaml-Multiple_include_functors-First-argument-1-T.md.gen + Oxcaml-Multiple_include_functors-Second.md.gen + Oxcaml-Multiple_include_functors-Second-argument-1-T.md.gen + Oxcaml-Include_functor_not_last.md.gen + Oxcaml-Include_functor_not_last-Make.md.gen + Oxcaml-Include_functor_not_last-Make-argument-1-T.md.gen) (package odoc) (action (run @@ -12614,6 +12856,78 @@ 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_argument_shapes.md + Oxcaml-Include_functor_argument_shapes.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg.md + Oxcaml-Include_functor_argument_shapes-module-type-Arg.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md + Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make.md + Oxcaml-Include_functor_argument_shapes-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-X.md + Oxcaml-Include_functor_argument_shapes-X.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-S.md + Oxcaml-Include_functor_argument_shapes-module-type-S.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md + Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12659,8 +12973,8 @@ (package odoc) (action (diff - Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.md - Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.md.gen)) + Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md + Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md.gen)) (enabled_if %{ocaml-config:ox})) (rule (alias runtest) @@ -12683,8 +12997,8 @@ (package odoc) (action (diff - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md - Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md.gen)) + Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md + Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md.gen)) (enabled_if %{ocaml-config:ox})) (rule (alias runtest) @@ -12723,6 +13037,70 @@ (diff Oxcaml-Anonymous_functor_desugared.md Oxcaml-Anonymous_functor_desugared.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors.md + Oxcaml-Multiple_include_functors.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-First.md + Oxcaml-Multiple_include_functors-First.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-First-argument-1-T.md + Oxcaml-Multiple_include_functors-First-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-Second.md + Oxcaml-Multiple_include_functors-Second.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Multiple_include_functors-Second-argument-1-T.md + Oxcaml-Multiple_include_functors-Second-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_not_last.md + Oxcaml-Include_functor_not_last.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_not_last-Make.md + Oxcaml-Include_functor_not_last-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_not_last-Make-argument-1-T.md + Oxcaml-Include_functor_not_last-Make-argument-1-T.md.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12758,7 +13136,16 @@ Oxcaml_impl-Resolve_functor.html.gen Oxcaml_impl-Resolve_functor-F.html.gen Oxcaml_impl-Resolve_functor-F-argument-1-I.html.gen - Oxcaml_impl-Resolve_functor-M.html.gen) + Oxcaml_impl-Resolve_functor-M.html.gen + Oxcaml_impl-Multiple_include_functors.html.gen + Oxcaml_impl-Multiple_include_functors-First.html.gen + Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html.gen + Oxcaml_impl-Multiple_include_functors-Second.html.gen + Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html.gen + Oxcaml_impl-Include_functor_not_last.html.gen + Oxcaml_impl-Include_functor_not_last-Make.html.gen + Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html.gen + Oxcaml_impl-Anonymous_functor.html.gen) (package odoc) (action (run @@ -12869,6 +13256,78 @@ (diff Oxcaml_impl-Resolve_functor-M.html Oxcaml_impl-Resolve_functor-M.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors.html + Oxcaml_impl-Multiple_include_functors.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-First.html + Oxcaml_impl-Multiple_include_functors-First.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html + Oxcaml_impl-Multiple_include_functors-First-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-Second.html + Oxcaml_impl-Multiple_include_functors-Second.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html + Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor_not_last.html + Oxcaml_impl-Include_functor_not_last.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor_not_last-Make.html + Oxcaml_impl-Include_functor_not_last-Make.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html + Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Anonymous_functor.html + Oxcaml_impl-Anonymous_functor.html.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -12940,7 +13399,13 @@ Oxcaml_impl.Include_functor_desugared.Make.3o.gen Oxcaml_impl.Resolve_functor.3o.gen Oxcaml_impl.Resolve_functor.F.3o.gen - Oxcaml_impl.Resolve_functor.M.3o.gen) + Oxcaml_impl.Resolve_functor.M.3o.gen + Oxcaml_impl.Multiple_include_functors.3o.gen + Oxcaml_impl.Multiple_include_functors.First.3o.gen + Oxcaml_impl.Multiple_include_functors.Second.3o.gen + Oxcaml_impl.Include_functor_not_last.3o.gen + Oxcaml_impl.Include_functor_not_last.Make.3o.gen + Oxcaml_impl.Anonymous_functor.3o.gen) (package odoc) (action (run @@ -13021,6 +13486,54 @@ (diff Oxcaml_impl.Resolve_functor.M.3o Oxcaml_impl.Resolve_functor.M.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.Multiple_include_functors.3o + Oxcaml_impl.Multiple_include_functors.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.Multiple_include_functors.First.3o + Oxcaml_impl.Multiple_include_functors.First.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.Multiple_include_functors.Second.3o + Oxcaml_impl.Multiple_include_functors.Second.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.Include_functor_not_last.3o + Oxcaml_impl.Include_functor_not_last.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.Include_functor_not_last.Make.3o + Oxcaml_impl.Include_functor_not_last.Make.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl.Anonymous_functor.3o + Oxcaml_impl.Anonymous_functor.3o.gen)) (enabled_if %{ocaml-config:ox}))) (subdir @@ -13056,7 +13569,16 @@ Oxcaml_impl-Resolve_functor.md.gen Oxcaml_impl-Resolve_functor-F.md.gen Oxcaml_impl-Resolve_functor-F-argument-1-I.md.gen - Oxcaml_impl-Resolve_functor-M.md.gen) + Oxcaml_impl-Resolve_functor-M.md.gen + Oxcaml_impl-Multiple_include_functors.md.gen + Oxcaml_impl-Multiple_include_functors-First.md.gen + Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md.gen + Oxcaml_impl-Multiple_include_functors-Second.md.gen + Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md.gen + Oxcaml_impl-Include_functor_not_last.md.gen + Oxcaml_impl-Include_functor_not_last-Make.md.gen + Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.md.gen + Oxcaml_impl-Anonymous_functor.md.gen) (package odoc) (action (run @@ -13161,6 +13683,78 @@ (diff Oxcaml_impl-Resolve_functor-M.md Oxcaml_impl-Resolve_functor-M.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors.md + Oxcaml_impl-Multiple_include_functors.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-First.md + Oxcaml_impl-Multiple_include_functors-First.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md + Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-Second.md + Oxcaml_impl-Multiple_include_functors-Second.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md + Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor_not_last.md + Oxcaml_impl-Include_functor_not_last.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor_not_last-Make.md + Oxcaml_impl-Include_functor_not_last-Make.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.md + Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml_impl-Anonymous_functor.md + Oxcaml_impl-Anonymous_functor.md.gen)) (enabled_if %{ocaml-config:ox}))) (subdir diff --git a/test/generators/man/Oxcaml.3o b/test/generators/man/Oxcaml.3o index 3ba858ed5a..e182ef77f8 100644 --- a/test/generators/man/Oxcaml.3o +++ b/test/generators/man/Oxcaml.3o @@ -1206,6 +1206,8 @@ fn_both : int @ local \f[CB]\->\fR int @ local; .sp \f[CB]module\fR Include_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR .sp +\f[CB]module\fR Include_functor_argument_shapes : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp \f[CB]module\fR Include_functor_desugared : \f[CB]sig\fR \.\.\. \f[CB]end\fR .sp \f[CB]module\fR Include_functor_named_type_desugared : \f[CB]sig\fR \.\.\. \f[CB]end\fR @@ -1217,3 +1219,7 @@ fn_both : int @ local \f[CB]\->\fR int @ local; \f[CB]module\fR Anonymous_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR .sp \f[CB]module\fR Anonymous_functor_desugared : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Multiple_include_functors : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Include_functor_not_last : \f[CB]sig\fR \.\.\. \f[CB]end\fR diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o new file mode 100644 index 0000000000..43e5587ae8 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o @@ -0,0 +1,100 @@ + +.TH Include_functor_argument_shapes 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml\.Include_functor_argument_shapes\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR \f[CB]type\fR Arg = \f[CB]sig\fR +.br +.ti +2 +\f[CB]type\fR t +.sp +.ti +2 +\f[CB]type\fR 'a p +.sp +.ti +2 +\f[CB]type\fR _ anon +.sp +.ti +2 +\f[CB]module\fR X : \f[CB]sig\fR +.br +.ti +4 +\f[CB]type\fR v +.br +.ti +2 +\f[CB]end\fR +.sp +.ti +2 +\f[CB]module\fR \f[CB]type\fR S +.br +\f[CB]end\fR +.fi +.br +.ti +2 +Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types\. +.nf +.sp +\f[CB]module\fR Make (T : Arg) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR 'a p +.sp +\f[CB]type\fR _ anon +.sp +\f[CB]module\fR X : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR \f[CB]type\fR S = \f[CB]sig\fR +.br +.ti +2 +\f[CB]type\fR u +.br +\f[CB]end\fR +.sp +\f[CB]type\fR included +.fi +.br +.ti +2 +No parameters, so the alias odoc puts in the synthetic module is a bare type t = t\. +.nf +.sp +\f[CB]type\fR applied +.fi +.br +.ti +2 +A named parameter, which the alias threads through as type 'a p = 'a p\. +.nf +.sp +\f[CB]type\fR anonymous +.fi +.br +.ti +2 +An anonymous parameter: _ gives the alias no name to mention on the right, so one is invented, as type 'a0 anon = 'a0 anon\. +.nf +.sp +\f[CB]type\fR from_module +.fi +.br +.ti +2 +Reached through a submodule of the argument, aliased as module X = X\. +.nf +.sp +\f[CB]module\fR \f[CB]type\fR Reexported = \f[CB]sig\fR +.br +.ti +2 +\f[CB]type\fR u +.br +\f[CB]end\fR +.fi +.br +.ti +2 +A module type of the argument, aliased as a path to it\. +.nf + diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o new file mode 100644 index 0000000000..a9a4c2ccd9 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o @@ -0,0 +1,82 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.Make +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor_argument_shapes\.Make\fR +.in +.sp +.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 +.sp +.ti +2 +\f[CB]type\fR 'a p +.sp +.ti +2 +\f[CB]type\fR _ anon +.sp +.ti +2 +\f[CB]module\fR X : \f[CB]sig\fR +.br +.ti +4 +\f[CB]type\fR v +.br +.ti +2 +\f[CB]end\fR +.sp +.ti +2 +\f[CB]module\fR \f[CB]type\fR S +.br +\f[CB]end\fR +.sp +.in 3 +\fB2 Signature\fR +.in +.sp +\f[CB]type\fR included = T\.t +.fi +.br +.ti +2 +No parameters, so the alias odoc puts in the synthetic module is a bare type t = t\. +.nf +.sp +\f[CB]type\fR applied = int T\.p +.fi +.br +.ti +2 +A named parameter, which the alias threads through as type 'a p = 'a p\. +.nf +.sp +\f[CB]type\fR anonymous = bool T\.anon +.fi +.br +.ti +2 +An anonymous parameter: _ gives the alias no name to mention on the right, so one is invented, as type 'a0 anon = 'a0 anon\. +.nf +.sp +\f[CB]type\fR from_module = T\.X\.v +.fi +.br +.ti +2 +Reached through a submodule of the argument, aliased as module X = X\. +.nf +.sp +\f[CB]module\fR \f[CB]type\fR Reexported = T\.S +.fi +.br +.ti +2 +A module type of the argument, aliased as a path to it\. +.nf + diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.X.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.X.3o new file mode 100644 index 0000000000..aa96c97e90 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.X.3o @@ -0,0 +1,14 @@ + +.TH X 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.X +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor_argument_shapes\.X\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]type\fR v diff --git a/test/generators/man/Oxcaml.Include_functor_desugared.3o b/test/generators/man/Oxcaml.Include_functor_desugared.3o index fbc74caf54..63f701f648 100644 --- a/test/generators/man/Oxcaml.Include_functor_desugared.3o +++ b/test/generators/man/Oxcaml.Include_functor_desugared.3o @@ -12,7 +12,12 @@ Oxcaml\.Include_functor_desugared .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 is the desugared version of \f[CI]Include_functor\fR: the synthetic module aliases the preceding items rather than copying them, so that the types the functor inherits from its argument resolve back to them\. +.nf .sp \f[CB]type\fR t .sp -\f[CB]type\fR included +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml.Include_functor_desugared.Make.3o b/test/generators/man/Oxcaml.Include_functor_desugared.Make.3o index c50862fc31..2b4761681a 100644 --- a/test/generators/man/Oxcaml.Include_functor_desugared.Make.3o +++ b/test/generators/man/Oxcaml.Include_functor_desugared.Make.3o @@ -8,6 +8,9 @@ Oxcaml\.Include_functor_desugared\.Make \fBModule Include_functor_desugared\.Make\fR .in .sp +.fi +This module is the desugared version of \f[CI]Include_functor\fR: the synthetic module aliases the preceding items rather than copying them, so that the types the functor inherits from its argument resolve back to them\. +.nf .SH Documentation .sp .nf diff --git a/test/generators/man/Oxcaml.Include_functor_named_type.3o b/test/generators/man/Oxcaml.Include_functor_named_type.3o index 545ffb1499..d507cd1cdf 100644 --- a/test/generators/man/Oxcaml.Include_functor_named_type.3o +++ b/test/generators/man/Oxcaml.Include_functor_named_type.3o @@ -19,7 +19,7 @@ Oxcaml\.Include_functor_named_type \fB1\.1 Parameters\fR .sp .ti +2 -\f[CB]module\fR _ : \f[CB]sig\fR +\f[CB]module\fR X : \f[CB]sig\fR .br .ti +4 \f[CB]type\fR t @@ -31,7 +31,7 @@ Oxcaml\.Include_functor_named_type \fB1\.2 Signature\fR .sp .ti +2 -\f[CB]type\fR included +\f[CB]type\fR included = X\.t .br \f[CB]end\fR .fi diff --git a/test/generators/man/Oxcaml.Include_functor_named_type_desugared.3o b/test/generators/man/Oxcaml.Include_functor_named_type_desugared.3o index 2baf447b54..0781daf00c 100644 --- a/test/generators/man/Oxcaml.Include_functor_named_type_desugared.3o +++ b/test/generators/man/Oxcaml.Include_functor_named_type_desugared.3o @@ -19,7 +19,7 @@ Oxcaml\.Include_functor_named_type_desugared \fB1\.1 Parameters\fR .sp .ti +2 -\f[CB]module\fR _ : \f[CB]sig\fR +\f[CB]module\fR X : \f[CB]sig\fR .br .ti +4 \f[CB]type\fR t @@ -31,15 +31,15 @@ Oxcaml\.Include_functor_named_type_desugared \fB1\.2 Signature\fR .sp .ti +2 -\f[CB]type\fR included +\f[CB]type\fR included = X\.t .br \f[CB]end\fR .fi .br .ti +2 -This is a module where the functor is named and then included\. +This is the desugared version of \f[CI]Include_functor_named_type\fR\. .nf .sp \f[CB]type\fR t .sp -\f[CB]type\fR included +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml.Include_functor_not_last.3o b/test/generators/man/Oxcaml.Include_functor_not_last.3o new file mode 100644 index 0000000000..b863396ee4 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_not_last.3o @@ -0,0 +1,23 @@ + +.TH Include_functor_not_last 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_not_last +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml\.Include_functor_not_last\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 +An include functor that is not the last item of the signature\. +.nf +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR after diff --git a/test/generators/man/Oxcaml.Include_functor_not_last.Make.3o b/test/generators/man/Oxcaml.Include_functor_not_last.Make.3o new file mode 100644 index 0000000000..c01f7568cc --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_not_last.Make.3o @@ -0,0 +1,33 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_not_last\.Make +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor_not_last\.Make\fR +.in +.sp +.fi +An include functor that is not the last item of the signature\. +.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 = T\.t diff --git a/test/generators/man/Oxcaml.Multiple_include_functors.3o b/test/generators/man/Oxcaml.Multiple_include_functors.3o new file mode 100644 index 0000000000..7798c4411b --- /dev/null +++ b/test/generators/man/Oxcaml.Multiple_include_functors.3o @@ -0,0 +1,29 @@ + +.TH Multiple_include_functors 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Multiple_include_functors +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml\.Multiple_include_functors\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR First (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.fi +.br +.ti +2 +Two include functors in the same signature, with an item defined between them\. +.nf +.sp +\f[CB]module\fR Second (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR between +.sp +\f[CB]type\fR second = BODY__49\.first +.sp +\f[CB]type\fR third diff --git a/test/generators/man/Oxcaml.Multiple_include_functors.First.3o b/test/generators/man/Oxcaml.Multiple_include_functors.First.3o new file mode 100644 index 0000000000..b07b6639d7 --- /dev/null +++ b/test/generators/man/Oxcaml.Multiple_include_functors.First.3o @@ -0,0 +1,33 @@ + +.TH First 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Multiple_include_functors\.First +.SH Synopsis +.sp +.in 2 +\fBModule Multiple_include_functors\.First\fR +.in +.sp +.fi +Two include functors in the same signature, with an item defined between them\. +.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 first = T\.t diff --git a/test/generators/man/Oxcaml.Multiple_include_functors.Second.3o b/test/generators/man/Oxcaml.Multiple_include_functors.Second.3o new file mode 100644 index 0000000000..7fefdbb78b --- /dev/null +++ b/test/generators/man/Oxcaml.Multiple_include_functors.Second.3o @@ -0,0 +1,38 @@ + +.TH Second 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Multiple_include_functors\.Second +.SH Synopsis +.sp +.in 2 +\fBModule Multiple_include_functors\.Second\fR +.in +.sp +.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 +.sp +.ti +2 +\f[CB]type\fR first +.sp +.ti +2 +\f[CB]type\fR between +.br +\f[CB]end\fR +.sp +.in 3 +\fB2 Signature\fR +.in +.sp +\f[CB]type\fR second = T\.first +.sp +\f[CB]type\fR third = T\.between diff --git a/test/generators/man/Oxcaml_impl.3o b/test/generators/man/Oxcaml_impl.3o index af272fb947..37d431bd8b 100644 --- a/test/generators/man/Oxcaml_impl.3o +++ b/test/generators/man/Oxcaml_impl.3o @@ -153,3 +153,9 @@ Multiple modes on argument and return\. \f[CB]module\fR Include_functor_desugared : \f[CB]sig\fR \.\.\. \f[CB]end\fR .sp \f[CB]module\fR Resolve_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Multiple_include_functors : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Include_functor_not_last : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]module\fR Anonymous_functor : \f[CB]sig\fR \.\.\. \f[CB]end\fR diff --git a/test/generators/man/Oxcaml_impl.Anonymous_functor.3o b/test/generators/man/Oxcaml_impl.Anonymous_functor.3o new file mode 100644 index 0000000000..7d1a842062 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Anonymous_functor.3o @@ -0,0 +1,21 @@ + +.TH Anonymous_functor 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Anonymous_functor +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml_impl\.Anonymous_functor\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]type\fR t +.fi +.br +.ti +2 +The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every include functor in a signature\. +.nf +.sp +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml_impl.Include_functor.3o b/test/generators/man/Oxcaml_impl.Include_functor.3o index f6e8495987..1478dce3b8 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor.3o @@ -15,7 +15,7 @@ Oxcaml_impl\.Include_functor .fi .br .ti +2 -This module demonstrates the include functor functionality +This module demonstrates the include functor functionality\. Make uses its argument, so included has to come out equal to t rather than abstract\. .nf .sp \f[CB]type\fR t diff --git a/test/generators/man/Oxcaml_impl.Include_functor.Make.3o b/test/generators/man/Oxcaml_impl.Include_functor.Make.3o index 96f021e2dd..0b1aade6a4 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor.Make.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor.Make.3o @@ -9,7 +9,7 @@ Oxcaml_impl\.Include_functor\.Make .in .sp .fi -This module demonstrates the include functor functionality +This module demonstrates the include functor functionality\. Make uses its argument, so included has to come out equal to t rather than abstract\. .nf .SH Documentation .sp @@ -30,4 +30,4 @@ This module demonstrates the include functor functionality \fB2 Signature\fR .in .sp -\f[CB]type\fR included +\f[CB]type\fR included = T\.t diff --git a/test/generators/man/Oxcaml_impl.Include_functor_desugared.3o b/test/generators/man/Oxcaml_impl.Include_functor_desugared.3o index 1e2e93e3d8..bff45706a9 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor_desugared.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor_desugared.3o @@ -20,4 +20,4 @@ This module is the desugared version from above .sp \f[CB]type\fR t .sp -\f[CB]type\fR included = Make(DUMMY__)\.included +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml_impl.Include_functor_desugared.Make.3o b/test/generators/man/Oxcaml_impl.Include_functor_desugared.Make.3o index 3c1795deb2..d7b3a86992 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor_desugared.Make.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor_desugared.Make.3o @@ -30,4 +30,4 @@ This module is the desugared version from above \fB2 Signature\fR .in .sp -\f[CB]type\fR included +\f[CB]type\fR included = T\.t diff --git a/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o b/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o new file mode 100644 index 0000000000..652dadf760 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o @@ -0,0 +1,23 @@ + +.TH Include_functor_not_last 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Include_functor_not_last +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml_impl\.Include_functor_not_last\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 +An include functor that is not the last item of the structure\. +.nf +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR after = string diff --git a/test/generators/man/Oxcaml_impl.Include_functor_not_last.Make.3o b/test/generators/man/Oxcaml_impl.Include_functor_not_last.Make.3o new file mode 100644 index 0000000000..b9829c433e --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Include_functor_not_last.Make.3o @@ -0,0 +1,33 @@ + +.TH Make 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Include_functor_not_last\.Make +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor_not_last\.Make\fR +.in +.sp +.fi +An include functor that is not the last item of the structure\. +.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 = T\.t diff --git a/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o b/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o new file mode 100644 index 0000000000..58194a8bb7 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o @@ -0,0 +1,29 @@ + +.TH Multiple_include_functors 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Multiple_include_functors +.SH Synopsis +.sp +.in 2 +\fBModule Oxcaml_impl\.Multiple_include_functors\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]module\fR First (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.fi +.br +.ti +2 +Two include functors in the same structure, with an item defined between them\. +.nf +.sp +\f[CB]module\fR Second (T : \f[CB]sig\fR \.\.\. \f[CB]end\fR) : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]type\fR t +.sp +\f[CB]type\fR between +.sp +\f[CB]type\fR second = BODY__15\.first +.sp +\f[CB]type\fR third diff --git a/test/generators/man/Oxcaml_impl.Multiple_include_functors.First.3o b/test/generators/man/Oxcaml_impl.Multiple_include_functors.First.3o new file mode 100644 index 0000000000..d854def1ed --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Multiple_include_functors.First.3o @@ -0,0 +1,33 @@ + +.TH First 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Multiple_include_functors\.First +.SH Synopsis +.sp +.in 2 +\fBModule Multiple_include_functors\.First\fR +.in +.sp +.fi +Two include functors in the same structure, with an item defined between them\. +.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 first = T\.t diff --git a/test/generators/man/Oxcaml_impl.Multiple_include_functors.Second.3o b/test/generators/man/Oxcaml_impl.Multiple_include_functors.Second.3o new file mode 100644 index 0000000000..5de41b2de3 --- /dev/null +++ b/test/generators/man/Oxcaml_impl.Multiple_include_functors.Second.3o @@ -0,0 +1,38 @@ + +.TH Second 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml_impl\.Multiple_include_functors\.Second +.SH Synopsis +.sp +.in 2 +\fBModule Multiple_include_functors\.Second\fR +.in +.sp +.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 +.sp +.ti +2 +\f[CB]type\fR first +.sp +.ti +2 +\f[CB]type\fR between +.br +\f[CB]end\fR +.sp +.in 3 +\fB2 Signature\fR +.in +.sp +\f[CB]type\fR second = T\.first +.sp +\f[CB]type\fR third = T\.between diff --git a/test/generators/man/oxcaml.targets b/test/generators/man/oxcaml.targets index f889ffeca8..0b3ba64404 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -10,6 +10,9 @@ Oxcaml.No_include_functor.Make.3o Oxcaml.No_include_functor.T.3o Oxcaml.Include_functor.3o Oxcaml.Include_functor.Make.3o +Oxcaml.Include_functor_argument_shapes.3o +Oxcaml.Include_functor_argument_shapes.Make.3o +Oxcaml.Include_functor_argument_shapes.X.3o Oxcaml.Include_functor_desugared.3o Oxcaml.Include_functor_desugared.Make.3o Oxcaml.Include_functor_named_type_desugared.3o @@ -17,3 +20,8 @@ Oxcaml.Include_functor_named_type.3o Oxcaml.Include_functor_inline.3o Oxcaml.Anonymous_functor.3o Oxcaml.Anonymous_functor_desugared.3o +Oxcaml.Multiple_include_functors.3o +Oxcaml.Multiple_include_functors.First.3o +Oxcaml.Multiple_include_functors.Second.3o +Oxcaml.Include_functor_not_last.3o +Oxcaml.Include_functor_not_last.Make.3o diff --git a/test/generators/man/oxcaml_impl.targets b/test/generators/man/oxcaml_impl.targets index 67557b2c49..f17b834c0c 100644 --- a/test/generators/man/oxcaml_impl.targets +++ b/test/generators/man/oxcaml_impl.targets @@ -8,3 +8,9 @@ Oxcaml_impl.Include_functor_desugared.Make.3o Oxcaml_impl.Resolve_functor.3o Oxcaml_impl.Resolve_functor.F.3o Oxcaml_impl.Resolve_functor.M.3o +Oxcaml_impl.Multiple_include_functors.3o +Oxcaml_impl.Multiple_include_functors.First.3o +Oxcaml_impl.Multiple_include_functors.Second.3o +Oxcaml_impl.Include_functor_not_last.3o +Oxcaml_impl.Include_functor_not_last.Make.3o +Oxcaml_impl.Anonymous_functor.3o diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md new file mode 100644 index 0000000000..a262282a31 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md @@ -0,0 +1,6 @@ + +# Module `T.X` + +```ocaml +type v +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md new file mode 100644 index 0000000000..024823f8b8 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md @@ -0,0 +1,18 @@ + +# Parameter `Make.T` + +```ocaml +type t +``` +```ocaml +type 'a p +``` +```ocaml +type _ anon +``` +```ocaml +module X : sig ... end +``` +```ocaml +module type S +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md new file mode 100644 index 0000000000..b2c056b688 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md @@ -0,0 +1,36 @@ + +# Module `Include_functor_argument_shapes.Make` + + +## Parameters + +```ocaml +module T : Arg +``` + +## Signature + +```ocaml +type included = T.t +``` +No parameters, so the alias odoc puts in the synthetic module is a bare `type t = t`. + +```ocaml +type applied = int T.p +``` +A named parameter, which the alias threads through as `type 'a p = 'a p`. + +```ocaml +type anonymous = bool T.anon +``` +An anonymous parameter: `_` gives the alias no name to mention on the right, so one is invented, as `type 'a0 anon = 'a0 anon`. + +```ocaml +type from_module = T.X.v +``` +Reached through a submodule of the argument, aliased as `module X = X`. + +```ocaml +module type Reexported = T.S +``` +A module type of the argument, aliased as a path to it. diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-X.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-X.md new file mode 100644 index 0000000000..fd6801a217 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-X.md @@ -0,0 +1,6 @@ + +# Module `Include_functor_argument_shapes.X` + +```ocaml +type v +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md new file mode 100644 index 0000000000..c80a0a7c54 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md @@ -0,0 +1,6 @@ + +# Module `Arg.X` + +```ocaml +type v +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md new file mode 100644 index 0000000000..560d4c293b --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md @@ -0,0 +1,20 @@ + +# Module type `Include_functor_argument_shapes.Arg` + +Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types. + +```ocaml +type t +``` +```ocaml +type 'a p +``` +```ocaml +type _ anon +``` +```ocaml +module X : sig ... end +``` +```ocaml +module type S +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md new file mode 100644 index 0000000000..69e689c4a9 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md @@ -0,0 +1,8 @@ + +# Module type `Include_functor_argument_shapes.Reexported` + +A module type of the argument, aliased as a path to it. + +```ocaml +type u +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-S.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-S.md new file mode 100644 index 0000000000..1755e09648 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-S.md @@ -0,0 +1,6 @@ + +# Module type `Include_functor_argument_shapes.S` + +```ocaml +type u +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md new file mode 100644 index 0000000000..901d262b4d --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md @@ -0,0 +1,50 @@ + +# Module `Oxcaml.Include_functor_argument_shapes` + +```ocaml +module type Arg = sig ... end +``` +Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types. + +```ocaml +module Make (T : Arg) : sig ... end +``` +```ocaml +type t +``` +```ocaml +type 'a p +``` +```ocaml +type _ anon +``` +```ocaml +module X : sig ... end +``` +```ocaml +module type S = sig ... end +``` +```ocaml +type included +``` +No parameters, so the alias odoc puts in the synthetic module is a bare `type t = t`. + +```ocaml +type applied +``` +A named parameter, which the alias threads through as `type 'a p = 'a p`. + +```ocaml +type anonymous +``` +An anonymous parameter: `_` gives the alias no name to mention on the right, so one is invented, as `type 'a0 anon = 'a0 anon`. + +```ocaml +type from_module +``` +Reached through a submodule of the argument, aliased as `module X = X`. + +```ocaml +module type Reexported = sig ... end +``` +A module type of the argument, aliased as a path to it. diff --git a/test/generators/markdown/Oxcaml-Include_functor_desugared-Make.md b/test/generators/markdown/Oxcaml-Include_functor_desugared-Make.md index 8ff67bb6a3..31e5c2020e 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_desugared-Make.md +++ b/test/generators/markdown/Oxcaml-Include_functor_desugared-Make.md @@ -1,6 +1,8 @@ # Module `Include_functor_desugared.Make` +This module is the desugared version of [`Include_functor`](./Oxcaml-Include_functor.md): the synthetic module aliases the preceding items rather than copying them, so that the types the functor inherits from its argument resolve back to them. + ## Parameters diff --git a/test/generators/markdown/Oxcaml-Include_functor_desugared.md b/test/generators/markdown/Oxcaml-Include_functor_desugared.md index 0b251dd285..3ee3fdc017 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_desugared.md +++ b/test/generators/markdown/Oxcaml-Include_functor_desugared.md @@ -4,9 +4,11 @@ ```ocaml module Make (T : sig ... end) : sig ... end ``` +This module is the desugared version of [`Include_functor`](./Oxcaml-Include_functor.md): the synthetic module aliases the preceding items rather than copying them, so that the types the functor inherits from its argument resolve back to them. + ```ocaml type t ``` ```ocaml -type included +type included = t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md new file mode 100644 index 0000000000..31dfe226ee --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md @@ -0,0 +1,6 @@ + +# Parameter `MakeType.X` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType.md b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType.md index f39f9b83e9..3eb283c22f 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType.md +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type-module-type-MakeType.md @@ -7,11 +7,11 @@ This is a module where the functor is named and then included. ## Parameters ```ocaml -module _ : sig ... end +module X : sig ... end ``` ## Signature ```ocaml -type included +type included = X.t ``` \ 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 index 5addc812e9..15e36a2472 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type.md +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type.md @@ -2,7 +2,7 @@ # Module `Oxcaml.Include_functor_named_type` ```ocaml -module type MakeType = functor (_ : sig ... end) -> sig ... end +module type MakeType = functor (X : sig ... end) -> sig ... end ``` This is a module where the functor is named and then included. diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md b/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md new file mode 100644 index 0000000000..31dfe226ee --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md @@ -0,0 +1,6 @@ + +# Parameter `MakeType.X` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md b/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md index 05af888e58..65a1943737 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md @@ -1,17 +1,17 @@ # Module type `Include_functor_named_type_desugared.MakeType` -This is a module where the functor is named and then included. +This is the desugared version of [`Include_functor_named_type`](./Oxcaml-Include_functor_named_type.md). ## Parameters ```ocaml -module _ : sig ... end +module X : sig ... end ``` ## Signature ```ocaml -type included +type included = X.t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared.md b/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared.md index 13d342f4cd..1f4cd369b3 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared.md +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type_desugared.md @@ -2,13 +2,13 @@ # Module `Oxcaml.Include_functor_named_type_desugared` ```ocaml -module type MakeType = functor (_ : sig ... end) -> sig ... end +module type MakeType = functor (X : sig ... end) -> sig ... end ``` -This is a module where the functor is named and then included. +This is the desugared version of [`Include_functor_named_type`](./Oxcaml-Include_functor_named_type.md). ```ocaml type t ``` ```ocaml -type included +type included = t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_not_last-Make-argument-1-T.md b/test/generators/markdown/Oxcaml-Include_functor_not_last-Make-argument-1-T.md new file mode 100644 index 0000000000..9459dc695c --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_not_last-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_not_last-Make.md b/test/generators/markdown/Oxcaml-Include_functor_not_last-Make.md new file mode 100644 index 0000000000..9b1c32a854 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_not_last-Make.md @@ -0,0 +1,17 @@ + +# Module `Include_functor_not_last.Make` + +An `include functor` that is not the last item of the signature. + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type included = T.t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_not_last.md b/test/generators/markdown/Oxcaml-Include_functor_not_last.md new file mode 100644 index 0000000000..6bf13972b4 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_not_last.md @@ -0,0 +1,14 @@ + +# Module `Oxcaml.Include_functor_not_last` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +An `include functor` that is not the last item of the signature. + +```ocaml +type t +``` +```ocaml +type after +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors-First-argument-1-T.md b/test/generators/markdown/Oxcaml-Multiple_include_functors-First-argument-1-T.md new file mode 100644 index 0000000000..8a1130630e --- /dev/null +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors-First-argument-1-T.md @@ -0,0 +1,6 @@ + +# Parameter `First.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors-First.md b/test/generators/markdown/Oxcaml-Multiple_include_functors-First.md new file mode 100644 index 0000000000..c5ff77d2db --- /dev/null +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors-First.md @@ -0,0 +1,17 @@ + +# Module `Multiple_include_functors.First` + +Two `include functor`s in the same signature, with an item defined between them. + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type first = T.t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors-Second-argument-1-T.md b/test/generators/markdown/Oxcaml-Multiple_include_functors-Second-argument-1-T.md new file mode 100644 index 0000000000..830672158c --- /dev/null +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors-Second-argument-1-T.md @@ -0,0 +1,12 @@ + +# Parameter `Second.T` + +```ocaml +type t +``` +```ocaml +type first +``` +```ocaml +type between +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors-Second.md b/test/generators/markdown/Oxcaml-Multiple_include_functors-Second.md new file mode 100644 index 0000000000..bc810bdf56 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors-Second.md @@ -0,0 +1,18 @@ + +# Module `Multiple_include_functors.Second` + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type second = T.first +``` +```ocaml +type third = T.between +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors.md b/test/generators/markdown/Oxcaml-Multiple_include_functors.md new file mode 100644 index 0000000000..48039fd289 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors.md @@ -0,0 +1,23 @@ + +# Module `Oxcaml.Multiple_include_functors` + +```ocaml +module First (T : sig ... end) : sig ... end +``` +Two `include functor`s in the same signature, with an item defined between them. + +```ocaml +module Second (T : sig ... end) : sig ... end +``` +```ocaml +type t +``` +```ocaml +type between +``` +```ocaml +type second = BODY__49.first +``` +```ocaml +type third +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml.md b/test/generators/markdown/Oxcaml.md index b03b9810c0..4f09b89809 100644 --- a/test/generators/markdown/Oxcaml.md +++ b/test/generators/markdown/Oxcaml.md @@ -705,6 +705,9 @@ module No_include_functor : sig ... end module Include_functor : sig ... end ``` ```ocaml +module Include_functor_argument_shapes : sig ... end +``` +```ocaml module Include_functor_desugared : sig ... end ``` ```ocaml @@ -721,4 +724,10 @@ module Anonymous_functor : sig ... end ``` ```ocaml module Anonymous_functor_desugared : sig ... end +``` +```ocaml +module Multiple_include_functors : sig ... end +``` +```ocaml +module Include_functor_not_last : sig ... end ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md b/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md new file mode 100644 index 0000000000..75a850a90f --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md @@ -0,0 +1,11 @@ + +# Module `Oxcaml_impl.Anonymous_functor` + +```ocaml +type t +``` +The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every `include functor` in a signature. + +```ocaml +type included = 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 index feffdf0f52..f62a1ae1d0 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor-Make.md @@ -1,7 +1,7 @@ # Module `Include_functor.Make` -This module demonstrates the `include functor` functionality +This module demonstrates the `include functor` functionality. `Make` uses its argument, so `included` has to come out equal to `t` rather than abstract. ## Parameters @@ -13,5 +13,5 @@ module T : sig ... end ## Signature ```ocaml -type included +type included = T.t ``` \ 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 index ec1748f768..1c483719dd 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor.md @@ -4,7 +4,7 @@ ```ocaml module Make (T : sig ... end) : sig ... end ``` -This module demonstrates the `include functor` functionality +This module demonstrates the `include functor` functionality. `Make` uses its argument, so `included` has to come out equal to `t` rather than abstract. ```ocaml type t diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor_desugared-Make.md b/test/generators/markdown/Oxcaml_impl-Include_functor_desugared-Make.md index d1cd3ce4af..8660b3fa9c 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor_desugared-Make.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor_desugared-Make.md @@ -13,5 +13,5 @@ module T : sig ... end ## Signature ```ocaml -type included +type included = T.t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor_desugared.md b/test/generators/markdown/Oxcaml_impl-Include_functor_desugared.md index 7bbfb15802..b64ce85068 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor_desugared.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor_desugared.md @@ -10,5 +10,5 @@ This module is the desugared version from above type t ``` ```ocaml -type included = Make(DUMMY__).included +type included = t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.md b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.md new file mode 100644 index 0000000000..9459dc695c --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last-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_not_last-Make.md b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last-Make.md new file mode 100644 index 0000000000..d5e3f136cb --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last-Make.md @@ -0,0 +1,17 @@ + +# Module `Include_functor_not_last.Make` + +An `include functor` that is not the last item of the structure. + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type included = T.t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md new file mode 100644 index 0000000000..c4986e628f --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md @@ -0,0 +1,14 @@ + +# Module `Oxcaml_impl.Include_functor_not_last` + +```ocaml +module Make (T : sig ... end) : sig ... end +``` +An `include functor` that is not the last item of the structure. + +```ocaml +type t +``` +```ocaml +type after = string +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md new file mode 100644 index 0000000000..8a1130630e --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md @@ -0,0 +1,6 @@ + +# Parameter `First.T` + +```ocaml +type t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First.md b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First.md new file mode 100644 index 0000000000..099b83d6bd --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-First.md @@ -0,0 +1,17 @@ + +# Module `Multiple_include_functors.First` + +Two `include functor`s in the same structure, with an item defined between them. + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type first = T.t +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md new file mode 100644 index 0000000000..830672158c --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md @@ -0,0 +1,12 @@ + +# Parameter `Second.T` + +```ocaml +type t +``` +```ocaml +type first +``` +```ocaml +type between +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second.md b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second.md new file mode 100644 index 0000000000..bc810bdf56 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors-Second.md @@ -0,0 +1,18 @@ + +# Module `Multiple_include_functors.Second` + + +## Parameters + +```ocaml +module T : sig ... end +``` + +## Signature + +```ocaml +type second = T.first +``` +```ocaml +type third = T.between +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md new file mode 100644 index 0000000000..75ee381202 --- /dev/null +++ b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md @@ -0,0 +1,23 @@ + +# Module `Oxcaml_impl.Multiple_include_functors` + +```ocaml +module First (T : sig ... end) : sig ... end +``` +Two `include functor`s in the same structure, with an item defined between them. + +```ocaml +module Second (T : sig ... end) : sig ... end +``` +```ocaml +type t +``` +```ocaml +type between +``` +```ocaml +type second = BODY__15.first +``` +```ocaml +type third +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl.md b/test/generators/markdown/Oxcaml_impl.md index 0c35aede34..d5297c2c2b 100644 --- a/test/generators/markdown/Oxcaml_impl.md +++ b/test/generators/markdown/Oxcaml_impl.md @@ -82,4 +82,13 @@ module Include_functor_desugared : sig ... end ``` ```ocaml module Resolve_functor : sig ... end +``` +```ocaml +module Multiple_include_functors : sig ... end +``` +```ocaml +module Include_functor_not_last : sig ... end +``` +```ocaml +module Anonymous_functor : sig ... end ``` \ No newline at end of file diff --git a/test/generators/markdown/oxcaml.targets b/test/generators/markdown/oxcaml.targets index 4be6eb5481..f570412fd1 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -15,17 +15,34 @@ 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_argument_shapes.md +Oxcaml-Include_functor_argument_shapes-module-type-Arg.md +Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md +Oxcaml-Include_functor_argument_shapes-Make.md +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md +Oxcaml-Include_functor_argument_shapes-X.md +Oxcaml-Include_functor_argument_shapes-module-type-S.md +Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md Oxcaml-Include_functor_desugared.md Oxcaml-Include_functor_desugared-Make.md Oxcaml-Include_functor_desugared-Make-argument-1-T.md Oxcaml-Include_functor_named_type_desugared.md Oxcaml-Include_functor_named_type_desugared-module-type-MakeType.md -Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-_.md +Oxcaml-Include_functor_named_type_desugared-module-type-MakeType-argument-1-X.md Oxcaml-Include_functor_named_type.md Oxcaml-Include_functor_named_type-module-type-MakeType.md -Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-_.md +Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X.md Oxcaml-Include_functor_inline.md Oxcaml-Include_functor_inline-module-type-Make.md Oxcaml-Include_functor_inline-module-type-Make-argument-1-_.md Oxcaml-Anonymous_functor.md Oxcaml-Anonymous_functor_desugared.md +Oxcaml-Multiple_include_functors.md +Oxcaml-Multiple_include_functors-First.md +Oxcaml-Multiple_include_functors-First-argument-1-T.md +Oxcaml-Multiple_include_functors-Second.md +Oxcaml-Multiple_include_functors-Second-argument-1-T.md +Oxcaml-Include_functor_not_last.md +Oxcaml-Include_functor_not_last-Make.md +Oxcaml-Include_functor_not_last-Make-argument-1-T.md diff --git a/test/generators/markdown/oxcaml_impl.targets b/test/generators/markdown/oxcaml_impl.targets index 572454bbee..e5472ec9c9 100644 --- a/test/generators/markdown/oxcaml_impl.targets +++ b/test/generators/markdown/oxcaml_impl.targets @@ -11,3 +11,12 @@ Oxcaml_impl-Resolve_functor.md Oxcaml_impl-Resolve_functor-F.md Oxcaml_impl-Resolve_functor-F-argument-1-I.md Oxcaml_impl-Resolve_functor-M.md +Oxcaml_impl-Multiple_include_functors.md +Oxcaml_impl-Multiple_include_functors-First.md +Oxcaml_impl-Multiple_include_functors-First-argument-1-T.md +Oxcaml_impl-Multiple_include_functors-Second.md +Oxcaml_impl-Multiple_include_functors-Second-argument-1-T.md +Oxcaml_impl-Include_functor_not_last.md +Oxcaml_impl-Include_functor_not_last-Make.md +Oxcaml_impl-Include_functor_not_last-Make-argument-1-T.md +Oxcaml_impl-Anonymous_functor.md From f9cc95aba094ad320d9c4c0a8e53acc8f51ecc35 Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Wed, 26 Aug 2026 16:51:48 +0100 Subject: [PATCH 16/23] Apply the include-functor path directly in signatures Simplifies the desugaring of: include functor Make which in a signature became module INCLUDE__1 : (hidden) module APPLIED__2 : module type of struct include INCLUDE__1(BODY__3) end include APPLIED__2 (hidden) where all that `APPLIED__2` achieves is giving the application a name to be referred to by. But `INCLUDE__1` is already a path, so the application can be written as one directly, as the structure reader has always done: module INCLUDE__1 : (hidden) include INCLUDE__1(BODY__3) That drops one generated module per `include functor`. Co-Authored-By: Claude Opus 5 (1M context) --- src/loader/cmi.ml | 21 ------------------ src/loader/cmi.mli | 2 -- src/loader/cmti.ml | 7 ++---- .../html/Oxcaml-Include_functor_inline.html | 22 +++++-------------- .../Oxcaml-Multiple_include_functors.html | 2 +- test/generators/latex/Oxcaml.tex | 2 +- .../man/Oxcaml.Multiple_include_functors.3o | 2 +- .../Oxcaml-Multiple_include_functors.md | 2 +- 8 files changed, 11 insertions(+), 49 deletions(-) diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index 3da9ef57d9..3fc99472d2 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -1679,24 +1679,3 @@ let generate_wrapper_module_sig parent ~include_functors wrapper ~hidden items = let dummy_module, include_dummy = wrapper_and_include parent wrapper ~hidden items in let include_functors = List.rev_map (fun include_ -> Signature.Include include_) include_functors in [dummy_module; include_dummy] @ include_functors - -let generate_wrapper_module_functor_type parent ~include_functors (dummy_id, dummy_path) ~hidden items = - let dummy_module, include_dummy = wrapper_and_include parent (dummy_id, dummy_path) ~hidden items in - (* functor type applied modules *) - let modules_and_applications = List.map (fun include_functor -> - match include_functor with - | {Include.decl = Include.Functor ({target=ModuleType mty; _} as f)} -> ( - let (id, path) = generate_wrapper_module parent ~prefix:"APPLIED" ~hidden in - let type_ = Module.ModuleType mty in - let functor_module : Module.t = {id; source_loc=None; doc=no_doc; type_; canonical=None; hidden} in - let module_ = Signature.Module (Ordinary, functor_module) in - let expansion = include_functor.Include.expansion in - let decl = Include.Functor {f with target = Path path} in - let application = Signature.Include {decl; parent; doc=no_doc; strengthened=None; loc=no_loc;expansion;status=`Default} in - [module_; application] - ) - | _ -> failwith "unexpected include which is not an include functor") include_functors - |> List.concat - in - [dummy_module; include_dummy] @ modules_and_applications - diff --git a/src/loader/cmi.mli b/src/loader/cmi.mli index 5af4928b32..d8980e81b1 100644 --- a/src/loader/cmi.mli +++ b/src/loader/cmi.mli @@ -132,5 +132,3 @@ val read_label_modalities : val generate_wrapper_module : Paths.Identifier.Signature.t -> prefix:string -> hidden:bool -> Paths.Identifier.Module.t * Paths.Path.Module.t val generate_wrapper_module_sig : Paths.Identifier.Signature.t -> include_functors:Odoc_model.Lang.Include.t list -> (Paths.Identifier.Module.t * Paths.Path.Module.t) -> hidden:bool -> Odoc_model.Lang.Signature.item list -> Odoc_model.Lang.Signature.item list - -val generate_wrapper_module_functor_type : Paths.Identifier.Signature.t -> include_functors:Odoc_model.Lang.Include.t list -> (Paths.Identifier.Module.t * Paths.Path.Module.t) -> hidden:bool -> Odoc_model.Lang.Signature.item list -> Odoc_model.Lang.Signature.item list diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index 0dd26123c8..ee2a27f831 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -927,10 +927,7 @@ and read_include env parent include_functor_wrapper incl = let functor_ : Module.t = {id; source_loc=None; doc; type_; canonical=None; hidden} in let functor_ = Signature.Module (Ordinary, functor_) in let module_path : Path.Module.t = `Apply (functor_path, include_functor_wrapper) in - - (* include that module *) - let mt : ModuleType.expr = ModuleType.TypeOf {t_desc = StructInclude module_path; t_original_path = module_path; t_expansion = None } in - let decl = Functor {target=ModuleType mt; original_ref=ModuleType expr} in + let decl = Functor {target=Path module_path; original_ref=ModuleType expr} in let include_ = Signature.Include {parent; doc; decl; expansion; status; strengthened=None; loc } in [functor_; include_]) #endif @@ -978,7 +975,7 @@ and read_signature : | [] -> items | include_functors -> (* if we have any include functor, we need to wrap *) - Cmi.generate_wrapper_module_functor_type parent ~include_functors (dummy_id, dummy_path) ~hidden items + Cmi.generate_wrapper_module_sig parent ~include_functors (dummy_id, dummy_path) ~hidden items in match doc_post with | {elements=[]; _} -> diff --git a/test/generators/html/Oxcaml-Include_functor_inline.html b/test/generators/html/Oxcaml-Include_functor_inline.html index ba7a297d4c..eb52658574 100644 --- a/test/generators/html/Oxcaml-Include_functor_inline.html +++ b/test/generators/html/Oxcaml-Include_functor_inline.html @@ -48,23 +48,11 @@

    Module Oxcaml.Include_functor_inline

    type t
    -
    -
    - - - include functor - Make - - - - -
    -
    - - type included -
    -
    -
    +
    +
    + + type included +
    diff --git a/test/generators/html/Oxcaml-Multiple_include_functors.html b/test/generators/html/Oxcaml-Multiple_include_functors.html index 2df9c13371..8c43372f66 100644 --- a/test/generators/html/Oxcaml-Multiple_include_functors.html +++ b/test/generators/html/Oxcaml-Multiple_include_functors.html @@ -81,7 +81,7 @@

    Module Oxcaml.Multiple_include_functors

    type second - = BODY__49.first + = BODY__44.first
    diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index d1e861c498..860f441581 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -503,7 +503,7 @@ \subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--sign \label{Oxcaml-Multiple_include_functors--module-Second}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Multiple_include_functors-Second-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ \label{Oxcaml-Multiple_include_functors--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \label{Oxcaml-Multiple_include_functors--type-between}\ocamlcodefragment{\ocamltag{keyword}{type} between}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}49.\allowbreak{}first}}}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}44.\allowbreak{}first}}}\\ \label{Oxcaml-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ diff --git a/test/generators/man/Oxcaml.Multiple_include_functors.3o b/test/generators/man/Oxcaml.Multiple_include_functors.3o index 7798c4411b..aa0c91d63f 100644 --- a/test/generators/man/Oxcaml.Multiple_include_functors.3o +++ b/test/generators/man/Oxcaml.Multiple_include_functors.3o @@ -24,6 +24,6 @@ Two include functors in the same signature, with an item defined between them\. .sp \f[CB]type\fR between .sp -\f[CB]type\fR second = BODY__49\.first +\f[CB]type\fR second = BODY__44\.first .sp \f[CB]type\fR third diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors.md b/test/generators/markdown/Oxcaml-Multiple_include_functors.md index 48039fd289..4751d45373 100644 --- a/test/generators/markdown/Oxcaml-Multiple_include_functors.md +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors.md @@ -16,7 +16,7 @@ type t type between ``` ```ocaml -type second = BODY__49.first +type second = BODY__44.first ``` ```ocaml type third From ea6c8489a65624a6c78cd01e2dce810f7e7557e2 Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Wed, 26 Aug 2026 16:52:16 +0100 Subject: [PATCH 17/23] Apply the include functor to a module expression in structures An `include functor` in a structure need not name its functor: type t include functor (functor (T : sig type t end) -> struct type included = T.t end) Co-Authored-By: Claude Opus 5 (1M context) --- src/loader/cmt.ml | 13 ++++++++ .../html/Oxcaml_impl-Anonymous_functor.html | 30 ++++++++++++++----- test/generators/latex/Oxcaml_impl.tex | 4 +-- .../man/Oxcaml_impl.Anonymous_functor.3o | 2 +- .../markdown/Oxcaml_impl-Anonymous_functor.md | 2 +- 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 402b38039f..325c7b6fb4 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -586,6 +586,11 @@ and read_include env parent include_functor_wrapper incl = let include_functor = Env.Path.read_module env.ident_env p in let target = `Apply (include_functor, include_functor_wrapper) in Some (`Functor (target, include_functor))) + | _, (Tincl_functor _ | Tincl_gen_functor _) -> + (* An [include functor] whose functor is not a path -- an anonymous + functor, say. There is nothing to apply, so bind it to a module + first, as the signature reader has to for every [include functor]. *) + Some (`Functor_expr (read_module_expr env parent container incl.incl_mod)) | Tmod_ident(p, _), Tincl_structure -> #else match unwrap_module_expr_desc incl.incl_mod.mod_desc with @@ -606,6 +611,14 @@ and read_include env parent include_functor_wrapper incl = | Some `Functor (target, original_ref) -> let decl = Include.Functor {target = Path target; original_ref=Path original_ref} in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] + | Some `Functor_expr mty -> + let hidden = true in + let id, functor_path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in + let functor_ : Module.t = {id; source_loc=None; doc; type_=ModuleType mty; canonical=None; hidden} in + let target : Path.Module.t = `Apply (functor_path, include_functor_wrapper) in + let decl = Include.Functor {target = Path target; original_ref=ModuleType mty} in + [Signature.Module (Ordinary, functor_); + Include {parent; doc; decl; expansion; status; strengthened=None; loc }] | _ -> content.items diff --git a/test/generators/html/Oxcaml_impl-Anonymous_functor.html b/test/generators/html/Oxcaml_impl-Anonymous_functor.html index 06a4c347c6..8ee25bbc00 100644 --- a/test/generators/html/Oxcaml_impl-Anonymous_functor.html +++ b/test/generators/html/Oxcaml_impl-Anonymous_functor.html @@ -28,13 +28,29 @@

    Module Oxcaml_impl.Anonymous_functor

    -
    -
    - - type included - = t - -
    +
    +
    + + + include functor + functor + ( + T + : sig ... + end) + -> + sig ... + end + + + +
    +
    + + type included +
    +
    +
    diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index 6bb665f28b..828aebccc1 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -79,9 +79,9 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \label{Oxcaml_impl-Include_functor_not_last--type-after}\ocamlcodefragment{\ocamltag{keyword}{type} after = string}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml_impl--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml_impl-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every \ocamlinlinecode{include functor} in a signature.\end{ocamlindent}% +\label{Oxcaml_impl--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml_impl-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml_impl-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every \ocamlinlinecode{include functor} in a signature.\end{ocamlindent}% \medbreak -\label{Oxcaml_impl-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-Anonymous_functor--type-t]{\ocamlinlinecode{t}}}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml_impl-Anonymous_functor-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml_impl-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ diff --git a/test/generators/man/Oxcaml_impl.Anonymous_functor.3o b/test/generators/man/Oxcaml_impl.Anonymous_functor.3o index 7d1a842062..6cd82e6a99 100644 --- a/test/generators/man/Oxcaml_impl.Anonymous_functor.3o +++ b/test/generators/man/Oxcaml_impl.Anonymous_functor.3o @@ -18,4 +18,4 @@ Oxcaml_impl\.Anonymous_functor The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every include functor in a signature\. .nf .sp -\f[CB]type\fR included = t +\f[CB]type\fR included diff --git a/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md b/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md index 75a850a90f..906bf468f1 100644 --- a/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md +++ b/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md @@ -7,5 +7,5 @@ type t The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every `include functor` in a signature. ```ocaml -type included = t +type included ``` \ No newline at end of file From c83705a37cd8b5e231b8ae1b3323ccd269e6f6e0 Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Wed, 26 Aug 2026 18:26:37 +0100 Subject: [PATCH 18/23] Give each `include functor` its own wrapper The wrapper module was allocated once per signature and shared, the enclosing signature was rebuilt as an `include` of it, and the include functors were partitioned out of the fold and re-emitted at the end. This had 2 issues: - the fold rebound the accumulator instead of appending to it, so only the include functors yielded by the *final* item of a signature survived. In practice that means an `include functor` was silently dropped unless nothing followed it: writing a single one and then a type below it lost the whole include, and of two in a row only the second was kept. - the shared wrapper was built from the non-include-functor items only, so a second `include functor` could not see the output of the first, and the reference to it leaked the hidden wrapper's name into the rendered output. Instead notice the `include functor` during the fold over a signature items and pass the accumulator directly. This ends up reverting the threading through of the `include_functor_wrapper` parameter. Co-Authored-By: Claude Opus 5 (1M context) --- src/loader/cmi.ml | 55 +++++---- src/loader/cmi.mli | 9 +- src/loader/cmt.ml | 105 +++++++++--------- src/loader/cmti.ml | 88 +++++++-------- src/model/lang.ml | 5 +- .../html/Oxcaml-Include_functor_not_last.html | 19 ++++ .../Oxcaml-Multiple_include_functors.html | 21 +++- .../Oxcaml_impl-Include_functor_not_last.html | 17 +++ ...Oxcaml_impl-Multiple_include_functors.html | 19 +++- test/generators/latex/Oxcaml.tex | 20 ++-- test/generators/latex/Oxcaml_impl.tex | 12 +- .../man/Oxcaml.Include_functor_not_last.3o | 2 + .../man/Oxcaml.Multiple_include_functors.3o | 4 +- .../Oxcaml_impl.Include_functor_not_last.3o | 2 + .../Oxcaml_impl.Multiple_include_functors.3o | 4 +- .../Oxcaml-Include_functor_not_last.md | 3 + .../Oxcaml-Multiple_include_functors.md | 5 +- .../Oxcaml_impl-Include_functor_not_last.md | 3 + .../Oxcaml_impl-Multiple_include_functors.md | 5 +- 19 files changed, 259 insertions(+), 139 deletions(-) diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index 3fc99472d2..4da8f9703d 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -1656,26 +1656,41 @@ let generate_wrapper_module = let dummy_path = `Identifier (dummy_id, hidden) in (dummy_id, dummy_path) -let shadow_nothing : Include.shadowed = - {s_modules=[]; s_module_types=[]; s_values=[]; s_types=[]; s_classes=[]; s_class_types=[]} - let no_doc : Odoc_model.Comment.docs = { elements = []; warnings_tag = None } -let no_loc = Odoc_model.Location_.span [] -let wrapper_and_include parent (dummy_id, dummy_path) ~hidden items = - let doc = no_doc in - let sig_ : Signature.t = {items; compiled=true; removed=[]; doc} in +(* [include functor F] is modelled as the application of [F] to a synthetic, + hidden module holding the items that precede the include. Those items are + copied under fresh identifiers, since they stay in the enclosing signature + too. *) +let wrapper_items dummy_id items = + let module Id = Identifier in + let name id = Id.name id in + let parent = (dummy_id : Id.Module.t :> Id.Signature.t) in + let rec wrapper_item item acc = + match (item : Signature.item) with + | Type (rec_, td) -> + let id = Id.Mk.type_ (parent, Odoc_model.Names.TypeName.make_std (name td.id)) in + Signature.Type (rec_, { td with TypeDecl.id; representation = None; canonical = None; source_loc = None }) :: acc + | Module (rec_, m) -> + let id = Id.Mk.module_ (parent, Odoc_model.Names.ModuleName.make_std (name m.id)) in + Signature.Module (rec_, { m with Module.id; canonical = None; hidden = false; source_loc = None }) :: acc + | ModuleType mt -> + let id = Id.Mk.module_type (parent, Odoc_model.Names.ModuleTypeName.make_std (name mt.id)) in + Signature.ModuleType { mt with ModuleType.id; canonical = None; source_loc = None } :: acc + | Include incl -> + (* The items an [include] brings in are visible to the functor too. *) + List.fold_left (fun acc item -> wrapper_item item acc) acc incl.Include.expansion.content.items + | Value _ | ModuleSubstitution _ | ModuleTypeSubstitution _ | Open _ + | TypeSubstitution _ | TypExt _ | Exception _ | Comment _ + | Class _ | ClassType _ -> + (* Nothing in the expansion of [F(BODY__n)] can refer to these. *) + acc + in + List.rev (List.fold_left (fun acc item -> wrapper_item item acc) [] items) + +let wrapper_module (dummy_id, _dummy_path) ~hidden items = + let items = wrapper_items dummy_id items in + let sig_ : Signature.t = { items; compiled = true; removed = []; doc = no_doc } in let type_ : Module.decl = ModuleType (Signature sig_) in - let module_ : Module.t = {id=dummy_id; source_loc=None; doc; type_; canonical=None; hidden} in - let dummy_module : Signature.item = Module (Ordinary, module_) in - let umt : ModuleType.U.expr = TypeOf (StructInclude dummy_path, dummy_path) in - let decl : Include.decl = ModuleType umt in - let expansion : Include.expansion = {shadowed=shadow_nothing; content=sig_} in - let include_ : Include.t = {loc=no_loc; parent; strengthened=None; doc; status=`Inline; decl; expansion} in - let include_dummy : Signature.item = Include include_ in - (dummy_module, include_dummy) - -let generate_wrapper_module_sig parent ~include_functors wrapper ~hidden items = - let dummy_module, include_dummy = wrapper_and_include parent wrapper ~hidden items in - let include_functors = List.rev_map (fun include_ -> Signature.Include include_) include_functors in - [dummy_module; include_dummy] @ include_functors + let module_ : Module.t = {id=dummy_id; source_loc=None; doc=no_doc; type_; canonical=None; hidden} in + Signature.Module (Ordinary, module_) diff --git a/src/loader/cmi.mli b/src/loader/cmi.mli index d8980e81b1..563bcd57c5 100644 --- a/src/loader/cmi.mli +++ b/src/loader/cmi.mli @@ -131,4 +131,11 @@ val read_label_modalities : val generate_wrapper_module : Paths.Identifier.Signature.t -> prefix:string -> hidden:bool -> Paths.Identifier.Module.t * Paths.Path.Module.t -val generate_wrapper_module_sig : Paths.Identifier.Signature.t -> include_functors:Odoc_model.Lang.Include.t list -> (Paths.Identifier.Module.t * Paths.Path.Module.t) -> hidden:bool -> Odoc_model.Lang.Signature.item list -> Odoc_model.Lang.Signature.item list +val wrapper_module : + Paths.Identifier.Module.t * Paths.Path.Module.t -> + hidden:bool -> + Odoc_model.Lang.Signature.item list -> + Odoc_model.Lang.Signature.item +(** [wrapper_module w ~hidden items] is the synthetic module an + [include functor] applies its functor to: a hidden module holding [items], + which are the items that precede the include. *) diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 325c7b6fb4..158931f11f 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -523,7 +523,7 @@ and read_module_bindings env parent mbs = |> fst |> List.rev -and read_structure_item env parent include_functor_wrapper item = +and read_structure_item env parent item = let open Signature in match item.str_desc with | Tstr_eval _ -> [] @@ -558,7 +558,7 @@ and read_structure_item env parent include_functor_wrapper item = | Tstr_open o -> [Open (read_open env parent o)] | Tstr_include incl -> - read_include env parent include_functor_wrapper incl + read_include env parent incl | Tstr_class cls -> let cls = List.map (fun (cl, _) -> cl) cls in read_class_declarations env parent cls @@ -574,54 +574,57 @@ and read_structure_item env parent include_functor_wrapper item = | None -> [] | Some doc -> [Comment doc] -and read_include env parent include_functor_wrapper incl = +and read_include env parent incl = let open Include in let loc = Doc_attr.read_location incl.incl_loc in let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in let doc, status = Doc_attr.attached ~warnings_tag:env.warnings_tag Odoc_model.Semantics.Expect_status container incl.incl_attributes in let decl_modty = -#if defined OXCAML - match unwrap_module_expr_desc incl.incl_mod.mod_desc, incl.incl_kind with - | Tmod_ident (p, _), (Tincl_functor _ | Tincl_gen_functor _) -> ( - let include_functor = Env.Path.read_module env.ident_env p in - let target = `Apply (include_functor, include_functor_wrapper) in - Some (`Functor (target, include_functor))) - | _, (Tincl_functor _ | Tincl_gen_functor _) -> - (* An [include functor] whose functor is not a path -- an anonymous - functor, say. There is nothing to apply, so bind it to a module - first, as the signature reader has to for every [include functor]. *) - Some (`Functor_expr (read_module_expr env parent container incl.incl_mod)) - | 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 (`Module_type (ModuleType.U.TypeOf (ModuleType.StructInclude p, p))) + Some (ModuleType.U.TypeOf (ModuleType.StructInclude p, p)) | _ -> let mty = read_module_expr env parent container incl.incl_mod in - umty_of_mty mty |> Option.map (fun m -> `Module_type m) + umty_of_mty mty 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 `Module_type m -> + | Some m -> let decl = ModuleType m in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] - | Some `Functor (target, original_ref) -> - let decl = Include.Functor {target = Path target; original_ref=Path original_ref} in - [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] - | Some `Functor_expr mty -> - let hidden = true in - let id, functor_path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in - let functor_ : Module.t = {id; source_loc=None; doc; type_=ModuleType mty; canonical=None; hidden} in - let target : Path.Module.t = `Apply (functor_path, include_functor_wrapper) in - let decl = Include.Functor {target = Path target; original_ref=ModuleType mty} in - [Signature.Module (Ordinary, functor_); - Include {parent; doc; decl; expansion; status; strengthened=None; loc }] - | _ -> + | None -> content.items +#if defined OXCAML +(* [include functor F] applies [F] to [wrapper], a synthetic module holding + everything defined before the include. [F] itself need not be a path -- it + can be an anonymous functor -- in which case it is bound to a module so that + there is something to apply. *) +and read_include_functor env parent wrapper incl = + let open Include in + let loc = Doc_attr.read_location incl.incl_loc in + let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in + let doc, status = Doc_attr.attached ~warnings_tag:env.warnings_tag Odoc_model.Semantics.Expect_status container incl.incl_attributes in + let content, shadowed = Cmi.read_signature_noenv env parent (Odoc_model.Compat.signature incl.incl_type) in + let expansion = { content; shadowed; } in + let bound, functor_path, original_ref = + match unwrap_module_expr_desc incl.incl_mod.mod_desc with + | Tmod_ident (p, _) -> + let p = Env.Path.read_module env.ident_env p in + ([], p, Path p) + | _ -> + let mty = read_module_expr env parent container incl.incl_mod in + let hidden = true in + let id, path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in + let m : Module.t = {id; source_loc=None; doc; type_=ModuleType mty; canonical=None; hidden} in + ([Signature.Module (Ordinary, m)], path, ModuleType mty) + in + let decl = Functor {target = Path (`Apply (functor_path, wrapper)); original_ref} in + bound @ [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] +#endif + and read_open env parent o = let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in let doc = Doc_attr.attached_no_tag ~warnings_tag:env.warnings_tag container o.open_attributes in @@ -629,6 +632,22 @@ and read_open env parent o = let expansion, _ = Cmi.read_signature_noenv env parent (Odoc_model.Compat.signature signature) in Open.{expansion; doc} +and read_items env parent items = + List.fold_left + (fun acc item -> + match item.str_desc with +#if defined OXCAML + | Tstr_include ({ incl_kind = (Tincl_functor _ | Tincl_gen_functor _); _ } as incl) -> + let hidden = true in + let wrapper = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in + let wrapper_module = Cmi.wrapper_module wrapper ~hidden (List.rev acc) in + let items = read_include_functor env parent (snd wrapper) incl in + List.rev_append items (wrapper_module :: acc) +#endif + | _ -> List.rev_append (read_structure_item env parent item) acc) + [] items + |> List.rev + and read_structure : 'tags. 'tags Odoc_model.Semantics.handle_internal_tags -> _ -> _ -> _ -> _ * 'tags = @@ -644,27 +663,7 @@ and read_structure : in Doc_attr.extract_top_comment internal_tags ~warnings_tag:env.warnings_tag ~classify parent str.str_items in - let hidden = true in - let dummy_id, dummy_path = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in - let items, include_functors = - List.fold_left - (fun (items, include_functors) item -> - let structure_items, include_functors = - read_structure_item env parent dummy_path item - |> Odoc_utils.List.partition_map (function - | Signature.Include ({ decl = Include.Functor _ } as include_functor) -> Odoc_utils.Either.Right include_functor - | otherwise -> Odoc_utils.Either.Left otherwise) - in - (List.rev_append structure_items items, include_functors)) - ([], []) items - in - let items = List.rev items in - let items = match include_functors with - | [] -> items - | include_functors -> - (* if we have any include functors, we need to wrap *) - Cmi.generate_wrapper_module_sig parent ~include_functors (dummy_id, dummy_path) ~hidden items - in + let items = read_items env parent items in match doc_post with | { elements = [] ; _} -> ({ Signature.items; compiled = false; removed = []; doc }, tags) diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index ee2a27f831..8401765c20 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -813,7 +813,7 @@ and read_module_equation env p = let open Module in Alias (Env.Path.read_module env.ident_env p, None) -and read_signature_item env parent include_functor_wrapper item = +and read_signature_item env parent item = let open Signature in match item.sig_desc with | Tsig_value vd -> @@ -847,7 +847,7 @@ and read_signature_item env parent include_functor_wrapper item = #else | Tsig_include incl -> #endif - read_include env parent include_functor_wrapper incl + read_include env parent incl | Tsig_class cls -> read_class_descriptions env parent cls | Tsig_class_type cltyps -> @@ -894,7 +894,7 @@ and read_module_type_substitution env parent mtd = -and read_include env parent include_functor_wrapper incl = +and read_include env parent incl = let open Include in let loc = Doc_attr.read_location incl.incl_loc in let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in @@ -907,32 +907,35 @@ and read_include env parent include_functor_wrapper incl = let include_parent = Identifier.fresh_include_parent parent in let include_container = (include_parent :> Identifier.LabelParent.t) in let expr = read_module_type env include_parent include_container incl.incl_mod in - let umty = Odoc_model.Lang.umty_of_mty expr in let expansion = { content; shadowed; } in -#if defined OXCAML - match umty, incl.incl_mod.mty_desc, incl.incl_kind with - | Some uexpr, _, Tincl_structure -> -#else - match umty with + match Odoc_model.Lang.umty_of_mty expr with | Some uexpr -> -#endif let decl = Include.ModuleType uexpr in [Include {parent; doc; decl; expansion; status; strengthened=None; loc }] + | None -> + content.items + #if defined OXCAML - | _, Tmty_typeof _, (Tincl_functor _ | Tincl_gen_functor _) - | _, Tmty_ident (_, _), (Tincl_functor _ | Tincl_gen_functor _) -> ( - let hidden = true in - let type_ : Module.decl = ModuleType expr in - let id, functor_path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in - let functor_ : Module.t = {id; source_loc=None; doc; type_; canonical=None; hidden} in - let functor_ = Signature.Module (Ordinary, functor_) in - let module_path : Path.Module.t = `Apply (functor_path, include_functor_wrapper) in - let decl = Functor {target=Path module_path; original_ref=ModuleType expr} in - let include_ = Signature.Include {parent; doc; decl; expansion; status; strengthened=None; loc } in - [functor_; include_]) +(* [include functor F] applies [F] to [wrapper], a synthetic module holding + everything defined before the include. A signature never has a path to [F] + -- only its module type -- so [F] is bound to a module to obtain one. *) +and read_include_functor env parent wrapper incl = + let open Include in + let loc = Doc_attr.read_location incl.incl_loc in + let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in + let doc, status = Doc_attr.attached ~warnings_tag:env.warnings_tag Odoc_model.Semantics.Expect_status container incl.incl_attributes in + let content, shadowed = Cmi.read_signature_noenv env parent (Odoc_model.Compat.signature incl.incl_type) in + let include_parent = Identifier.fresh_include_parent parent in + let include_container = (include_parent :> Identifier.LabelParent.t) in + let expr = read_module_type env include_parent include_container incl.incl_mod in + let expansion = { content; shadowed; } in + let hidden = true in + let id, functor_path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in + let functor_ : Module.t = {id; source_loc=None; doc; type_=ModuleType expr; canonical=None; hidden} in + let decl = Functor {target = Path (`Apply (functor_path, wrapper)); original_ref = ModuleType expr} in + [ Signature.Module (Ordinary, functor_); + Include {parent; doc; decl; expansion; status; strengthened=None; loc } ] #endif - | _ -> - content.items and read_open env parent o = let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in @@ -941,6 +944,23 @@ and read_open env parent o = let expansion, _ = Cmi.read_signature_noenv env parent (Odoc_model.Compat.signature signature) in { expansion; doc } +and read_items env parent items = + List.fold_left + (fun acc item -> + match item.sig_desc with +#if defined OXCAML + | Tsig_include ({ incl_kind = (Tincl_functor _ | Tincl_gen_functor _); + incl_mod = { mty_desc = (Tmty_typeof _ | Tmty_ident _); _ }; _ } as incl, _) -> + let hidden = true in + let wrapper = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in + let wrapper_module = Cmi.wrapper_module wrapper ~hidden (List.rev acc) in + let items = read_include_functor env parent (snd wrapper) incl in + List.rev_append items (wrapper_module :: acc) +#endif + | _ -> List.rev_append (read_signature_item env parent item) acc) + [] items + |> List.rev + and read_signature : 'tags. 'tags Odoc_model.Semantics.handle_internal_tags -> _ -> _ -> _ -> _ * 'tags = @@ -956,27 +976,7 @@ and read_signature : in Doc_attr.extract_top_comment internal_tags ~warnings_tag:env.warnings_tag ~classify parent sg.sig_items in - let hidden = true in - let dummy_id, dummy_path = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in - let items, include_functors = - List.fold_left - (fun (items, include_functors) item -> - let signature_items, include_functors = - read_signature_item env parent dummy_path item - |> Odoc_utils.List.partition_map (function - | Signature.Include ({ decl = Include.Functor _ } as include_functor) -> Odoc_utils.Either.Right include_functor - | otherwise -> Odoc_utils.Either.Left otherwise) - in - (List.rev_append signature_items items, include_functors)) - ([], []) items - in - let items = List.rev items in - let items = match include_functors with - | [] -> items - | include_functors -> - (* if we have any include functor, we need to wrap *) - Cmi.generate_wrapper_module_sig parent ~include_functors (dummy_id, dummy_path) ~hidden items - in + let items = read_items env parent items in match doc_post with | {elements=[]; _} -> ({ Signature.items; compiled = false; removed = []; doc }, tags) diff --git a/src/model/lang.ml b/src/model/lang.ml index 729e65eb7b..937d008064 100644 --- a/src/model/lang.ml +++ b/src/model/lang.ml @@ -648,7 +648,10 @@ let extract_signature_doc (s : Signature.t) = | { Include.status = `Inline; _ } -> true | { decl = Functor { original_ref = Path p }; _ } | { decl = Alias p; _ } -> Paths.Path.is_hidden (p :> Path.t) - | { decl = Functor { original_ref = ModuleType _ }; _ } -> assert false + | { decl = Functor { original_ref = ModuleType _ }; _ } -> + (* [include functor module type of ...]: nothing to be hidden behind, + so the enclosing signature does not inherit the top comment. *) + false | { decl = ModuleType expr; _ } -> uexpr_considered_hidden expr in match (s.doc, s.items) with diff --git a/test/generators/html/Oxcaml-Include_functor_not_last.html b/test/generators/html/Oxcaml-Include_functor_not_last.html index 2552bf255f..54b98915b1 100644 --- a/test/generators/html/Oxcaml-Include_functor_not_last.html +++ b/test/generators/html/Oxcaml-Include_functor_not_last.html @@ -44,6 +44,25 @@

    Module Oxcaml.Include_functor_not_last

    type t
    +
    +
    + + + include functor + module type + of + Make + + + +
    +
    + + type included +
    +
    +
    +
    diff --git a/test/generators/html/Oxcaml-Multiple_include_functors.html b/test/generators/html/Oxcaml-Multiple_include_functors.html index 8c43372f66..b31963ec4e 100644 --- a/test/generators/html/Oxcaml-Multiple_include_functors.html +++ b/test/generators/html/Oxcaml-Multiple_include_functors.html @@ -60,6 +60,25 @@

    Module Oxcaml.Multiple_include_functors

    type t
    +
    +
    + + + include functor + module type + of + First + + + +
    +
    + + type first +
    +
    +
    +
    @@ -81,7 +100,7 @@

    Module Oxcaml.Multiple_include_functors

    type second - = BODY__44.first + = t
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor_not_last.html b/test/generators/html/Oxcaml_impl-Include_functor_not_last.html index bbd0deeedb..df41eb1ed0 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor_not_last.html +++ b/test/generators/html/Oxcaml_impl-Include_functor_not_last.html @@ -47,6 +47,23 @@

    Module Oxcaml_impl.Include_functor_not_last type t

    +
    +
    + + + include functor + Make + + + +
    +
    + + type included +
    +
    +
    +
    diff --git a/test/generators/html/Oxcaml_impl-Multiple_include_functors.html b/test/generators/html/Oxcaml_impl-Multiple_include_functors.html index bb639f6187..67712b45de 100644 --- a/test/generators/html/Oxcaml_impl-Multiple_include_functors.html +++ b/test/generators/html/Oxcaml_impl-Multiple_include_functors.html @@ -66,6 +66,23 @@

    Module Oxcaml_impl.Multiple_include_functors type t

    +
    +
    + + + include functor + First + + + +
    +
    + + type first +
    +
    +
    +
    @@ -86,7 +103,7 @@

    Module Oxcaml_impl.Multiple_include_functors
    type second - = BODY__15.first + = t

    diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 860f441581..05857dea83 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -404,13 +404,13 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\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}% +\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} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \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_argument_shapes}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}argument\_\allowbreak{}shapes}}}\label{Oxcaml-Include_functor_argument_shapes}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_argument_shapes--module-type-Arg}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg]{\ocamlinlinecode{Arg}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\label{Oxcaml--module-Include_functor_argument_shapes}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}argument\_\allowbreak{}shapes}}}\label{Oxcaml-Include_functor_argument_shapes}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes--module-type-Arg}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg]{\ocamlinlinecode{Arg}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-p}\ocamlcodefragment{\ocamltag{keyword}{type} 'a p}\\ \label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-anon}\ocamlcodefragment{\ocamltag{keyword}{type} \_\allowbreak{} anon}\\ \label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--module-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg-X]{\ocamlinlinecode{X}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg-X--type-v}\ocamlcodefragment{\ocamltag{keyword}{type} v}\\ @@ -463,11 +463,11 @@ \subsubsection{Signature\label{Oxcaml-Include_functor_named_type_desugared-modul \ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Include_functor_named_type_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_named_type_desugared--type-t]{\ocamlinlinecode{t}}}\\ \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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_named_type--module-type-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_7}}% +\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-MakeType}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_named_type-module-type-MakeType--parameters_7}}% \label{Oxcaml-Include_functor_named_type-module-type-MakeType--argument-1-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X]{\ocamlinlinecode{X}}}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_7}}% +\subsubsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeType--signature_7}}% \label{Oxcaml-Include_functor_named_type-module-type-MakeType--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType-argument-1-X--type-t]{\ocamlinlinecode{X.\allowbreak{}t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor is named and then included.\end{ocamlindent}% @@ -476,11 +476,11 @@ \subsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-MakeTy \ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_8}}% +\label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_8}}% \label{Oxcaml-Include_functor_inline-module-type-Make--argument-1-_}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline-module-type-Make-argument-1-_]{\ocamlinlinecode{\_\allowbreak{}}}}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline-module-type-Make-argument-1-_--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_8}}% +\subsubsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--signature_8}}% \label{Oxcaml-Include_functor_inline-module-type-Make--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a test case where the functor is named and included inline\end{ocamlindent}% @@ -489,7 +489,7 @@ \subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--sign \ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_inline--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}In this test case the functor is defined inline\end{ocamlindent}% +\label{Oxcaml--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}In this test case the functor is defined inline\end{ocamlindent}% \medbreak \ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml-Anonymous_functor-include9_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% @@ -498,18 +498,20 @@ \subsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--sign \ocamltag{keyword}{include} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor_desugared--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml--module-Multiple_include_functors}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors]{\ocamlinlinecode{Multiple\_\allowbreak{}include\_\allowbreak{}functors}}}\label{Oxcaml-Multiple_include_functors}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Multiple_include_functors--module-First}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors-First]{\ocamlinlinecode{First}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Multiple_include_functors-First-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}Two \ocamlinlinecode{include functor}s in the same signature, with an item defined between them.\end{ocamlindent}% +\label{Oxcaml--module-Multiple_include_functors}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors]{\ocamlinlinecode{Multiple\_\allowbreak{}include\_\allowbreak{}functors}}}\label{Oxcaml-Multiple_include_functors}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Multiple_include_functors--module-First}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors-First]{\ocamlinlinecode{First}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Multiple_include_functors-First-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}Two \ocamlinlinecode{include functor}s in the same signature, with an item defined between them.\end{ocamlindent}% \medbreak \label{Oxcaml-Multiple_include_functors--module-Second}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Multiple_include_functors-Second-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ \label{Oxcaml-Multiple_include_functors--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-First]{\ocamlinlinecode{First}}\label{Oxcaml-Multiple_include_functors--type-first}\ocamlcodefragment{\ocamltag{keyword}{type} first}\\ \label{Oxcaml-Multiple_include_functors--type-between}\ocamlcodefragment{\ocamltag{keyword}{type} between}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}44.\allowbreak{}first}}}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[Oxcaml-Multiple_include_functors--type-t]{\ocamlinlinecode{t}}}\\ \label{Oxcaml-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Include_functor_not_last}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_not_last]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}not\_\allowbreak{}last}}}\label{Oxcaml-Include_functor_not_last}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_not_last--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_not_last-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}An \ocamlinlinecode{include functor} that is not the last item of the signature.\end{ocamlindent}% \medbreak \label{Oxcaml-Include_functor_not_last--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_not_last--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \label{Oxcaml-Include_functor_not_last--type-after}\ocamlcodefragment{\ocamltag{keyword}{type} after}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index 828aebccc1..048e1a2493 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -45,7 +45,7 @@ \subsubsection{Modes on values\label{Oxcaml_impl--modes-on-values}}% \label{Oxcaml_impl--val-mode_multi}\ocamlcodefragment{\ocamltag{keyword}{val} mode\_\allowbreak{}multi : string @ local once \ocamltag{arrow}{$\rightarrow$} string @ local once}\begin{ocamlindent}Multiple modes on argument and return.\end{ocamlindent}% \medbreak \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on-structures}}% -\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}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\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 demonstrates the \ocamlinlinecode{include functor} functionality. \ocamlinlinecode{Make} uses its argument, so \ocamlinlinecode{included} has to come out equal to \ocamlinlinecode{t} rather than abstract.\end{ocamlindent}% +\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 demonstrates the \ocamlinlinecode{include functor} functionality. \ocamlinlinecode{Make} uses its argument, so \ocamlinlinecode{included} has to come out equal to \ocamlinlinecode{t} rather than abstract.\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}\\ @@ -58,28 +58,30 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Resolve_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor]{\ocamlinlinecode{Resolve\_\allowbreak{}functor}}}\label{Oxcaml_impl-Resolve_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor--module-F}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Resolve_functor-F-argument-1-I]{\ocamlinlinecode{I}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ -\label{Oxcaml_impl-Resolve_functor--module-M}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-M]{\ocamlinlinecode{M}}}\label{Oxcaml_impl-Resolve_functor-M}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml_impl-Resolve_functor-M--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = float}\\ +\label{Oxcaml_impl-Resolve_functor--module-M}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-M]{\ocamlinlinecode{M}}}\label{Oxcaml_impl-Resolve_functor-M}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor-M--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = float}\\ \ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}\label{Oxcaml_impl-Resolve_functor-M--type-myt}\ocamlcodefragment{\ocamltag{keyword}{type} myt = float}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml_impl--module-Multiple_include_functors}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors]{\ocamlinlinecode{Multiple\_\allowbreak{}include\_\allowbreak{}functors}}}\label{Oxcaml_impl-Multiple_include_functors}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml_impl-Multiple_include_functors--module-First}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors-First]{\ocamlinlinecode{First}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Multiple_include_functors-First-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}Two \ocamlinlinecode{include functor}s in the same structure, with an item defined between them.\end{ocamlindent}% +\label{Oxcaml_impl--module-Multiple_include_functors}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors]{\ocamlinlinecode{Multiple\_\allowbreak{}include\_\allowbreak{}functors}}}\label{Oxcaml_impl-Multiple_include_functors}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Multiple_include_functors--module-First}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors-First]{\ocamlinlinecode{First}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Multiple_include_functors-First-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}Two \ocamlinlinecode{include functor}s in the same structure, with an item defined between them.\end{ocamlindent}% \medbreak \label{Oxcaml_impl-Multiple_include_functors--module-Second}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Multiple_include_functors-Second-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ \label{Oxcaml_impl-Multiple_include_functors--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-First]{\ocamlinlinecode{First}}\label{Oxcaml_impl-Multiple_include_functors--type-first}\ocamlcodefragment{\ocamltag{keyword}{type} first}\\ \label{Oxcaml_impl-Multiple_include_functors--type-between}\ocamlcodefragment{\ocamltag{keyword}{type} between}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml_impl-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}15.\allowbreak{}first}}}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml_impl-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[Oxcaml_impl-Multiple_include_functors--type-t]{\ocamlinlinecode{t}}}\\ \label{Oxcaml_impl-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Include_functor_not_last}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_not_last]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}not\_\allowbreak{}last}}}\label{Oxcaml_impl-Include_functor_not_last}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Include_functor_not_last--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Include_functor_not_last-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}An \ocamlinlinecode{include functor} that is not the last item of the structure.\end{ocamlindent}% \medbreak \label{Oxcaml_impl-Include_functor_not_last--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}\label{Oxcaml_impl-Include_functor_not_last--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \label{Oxcaml_impl-Include_functor_not_last--type-after}\ocamlcodefragment{\ocamltag{keyword}{type} after = string}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\label{Oxcaml_impl--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml_impl-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml_impl-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every \ocamlinlinecode{include functor} in a signature.\end{ocamlindent}% +\label{Oxcaml_impl--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml_impl-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every \ocamlinlinecode{include functor} in a signature.\end{ocamlindent}% \medbreak \ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml_impl-Anonymous_functor-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml_impl-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% diff --git a/test/generators/man/Oxcaml.Include_functor_not_last.3o b/test/generators/man/Oxcaml.Include_functor_not_last.3o index b863396ee4..8a7a26ab79 100644 --- a/test/generators/man/Oxcaml.Include_functor_not_last.3o +++ b/test/generators/man/Oxcaml.Include_functor_not_last.3o @@ -20,4 +20,6 @@ An include functor that is not the last item of the signature\. .sp \f[CB]type\fR t .sp +\f[CB]type\fR included +.sp \f[CB]type\fR after diff --git a/test/generators/man/Oxcaml.Multiple_include_functors.3o b/test/generators/man/Oxcaml.Multiple_include_functors.3o index aa0c91d63f..03692ad7fc 100644 --- a/test/generators/man/Oxcaml.Multiple_include_functors.3o +++ b/test/generators/man/Oxcaml.Multiple_include_functors.3o @@ -22,8 +22,10 @@ Two include functors in the same signature, with an item defined between them\. .sp \f[CB]type\fR t .sp +\f[CB]type\fR first +.sp \f[CB]type\fR between .sp -\f[CB]type\fR second = BODY__44\.first +\f[CB]type\fR second = t .sp \f[CB]type\fR third diff --git a/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o b/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o index 652dadf760..5798e72293 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o @@ -20,4 +20,6 @@ An include functor that is not the last item of the structure\. .sp \f[CB]type\fR t .sp +\f[CB]type\fR included +.sp \f[CB]type\fR after = string diff --git a/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o b/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o index 58194a8bb7..4c9a33867e 100644 --- a/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o +++ b/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o @@ -22,8 +22,10 @@ Two include functors in the same structure, with an item defined between them\. .sp \f[CB]type\fR t .sp +\f[CB]type\fR first +.sp \f[CB]type\fR between .sp -\f[CB]type\fR second = BODY__15\.first +\f[CB]type\fR second = t .sp \f[CB]type\fR third diff --git a/test/generators/markdown/Oxcaml-Include_functor_not_last.md b/test/generators/markdown/Oxcaml-Include_functor_not_last.md index 6bf13972b4..39df233d4d 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_not_last.md +++ b/test/generators/markdown/Oxcaml-Include_functor_not_last.md @@ -10,5 +10,8 @@ An `include functor` that is not the last item of the signature. type t ``` ```ocaml +type included +``` +```ocaml type after ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors.md b/test/generators/markdown/Oxcaml-Multiple_include_functors.md index 4751d45373..92845bdfeb 100644 --- a/test/generators/markdown/Oxcaml-Multiple_include_functors.md +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors.md @@ -13,10 +13,13 @@ module Second (T : sig ... end) : sig ... end type t ``` ```ocaml +type first +``` +```ocaml type between ``` ```ocaml -type second = BODY__44.first +type second = t ``` ```ocaml type third diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md index c4986e628f..af234557dc 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md @@ -10,5 +10,8 @@ An `include functor` that is not the last item of the structure. type t ``` ```ocaml +type included +``` +```ocaml type after = string ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md index 75ee381202..c076eb2b8f 100644 --- a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md +++ b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md @@ -13,10 +13,13 @@ module Second (T : sig ... end) : sig ... end type t ``` ```ocaml +type first +``` +```ocaml type between ``` ```ocaml -type second = BODY__15.first +type second = t ``` ```ocaml type third From 769cd7ce9668d36ff547ca04cfecbddd53b2805b Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Wed, 26 Aug 2026 18:26:39 +0100 Subject: [PATCH 19/23] Build the include-functor wrapper out of aliases Rather than put the functor arguments in a module and `include` it, leave them where they were and construct a synthetic module that's just full of aliases to the items. Suggested by @panglesd in #1452. Co-Authored-By: Claude Opus 5 (1M context) --- src/loader/cmi.ml | 47 +++++++++++++++---- src/loader/cmi.mli | 6 ++- .../html/Oxcaml-Include_functor.html | 4 +- ...rgument_shapes-module-type-Reexported.html | 34 -------------- ...xcaml-Include_functor_argument_shapes.html | 28 +++++++---- .../Oxcaml-Include_functor_named_type.html | 4 +- .../html/Oxcaml-Include_functor_not_last.html | 4 +- .../Oxcaml-Multiple_include_functors.html | 10 ++-- .../html/Oxcaml_impl-Anonymous_functor.html | 4 +- .../html/Oxcaml_impl-Include_functor.html | 4 +- .../Oxcaml_impl-Include_functor_not_last.html | 4 +- ...Oxcaml_impl-Multiple_include_functors.html | 10 ++-- .../html/Oxcaml_impl-Resolve_functor-M.html | 2 +- test/generators/html/oxcaml.targets | 1 - test/generators/latex/Oxcaml.tex | 24 +++++----- test/generators/latex/Oxcaml_impl.tex | 14 +++--- test/generators/link.dune.inc | 18 ------- test/generators/man/Oxcaml.Include_functor.3o | 2 +- .../Oxcaml.Include_functor_argument_shapes.3o | 15 ++---- .../man/Oxcaml.Include_functor_named_type.3o | 2 +- .../man/Oxcaml.Include_functor_not_last.3o | 2 +- .../man/Oxcaml.Multiple_include_functors.3o | 6 +-- .../man/Oxcaml_impl.Anonymous_functor.3o | 2 +- .../man/Oxcaml_impl.Include_functor.3o | 2 +- .../Oxcaml_impl.Include_functor_not_last.3o | 2 +- .../Oxcaml_impl.Multiple_include_functors.3o | 6 +-- .../man/Oxcaml_impl.Resolve_functor.M.3o | 2 +- .../markdown/Oxcaml-Include_functor.md | 2 +- ..._argument_shapes-module-type-Reexported.md | 8 ---- .../Oxcaml-Include_functor_argument_shapes.md | 10 ++-- .../Oxcaml-Include_functor_named_type.md | 2 +- .../Oxcaml-Include_functor_not_last.md | 2 +- .../Oxcaml-Multiple_include_functors.md | 6 +-- .../markdown/Oxcaml_impl-Anonymous_functor.md | 2 +- .../markdown/Oxcaml_impl-Include_functor.md | 2 +- .../Oxcaml_impl-Include_functor_not_last.md | 2 +- .../Oxcaml_impl-Multiple_include_functors.md | 6 +-- .../markdown/Oxcaml_impl-Resolve_functor-M.md | 2 +- test/generators/markdown/oxcaml.targets | 1 - 39 files changed, 148 insertions(+), 156 deletions(-) delete mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html delete mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index 4da8f9703d..5e78da77ad 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -1659,32 +1659,63 @@ let generate_wrapper_module = let no_doc : Odoc_model.Comment.docs = { elements = []; warnings_tag = None } (* [include functor F] is modelled as the application of [F] to a synthetic, - hidden module holding the items that precede the include. Those items are - copied under fresh identifiers, since they stay in the enclosing signature - too. *) + hidden module holding the items that precede the include. + + That module's items are *aliases* of the real ones rather than copies: the + expansion of [F(BODY__n)] refers to the functor argument, so a copy would + leave the expansion mentioning [BODY__n.t], a hidden path, which the + generator renders as an abstract [type t]. With an alias, [BODY__n.t] + reduces to the enclosing signature's own [t] and is rendered, and linked, as + such. *) let wrapper_items dummy_id items = let module Id = Identifier in let name id = Id.name id in let parent = (dummy_id : Id.Module.t :> Id.Signature.t) in + (* Anonymous parameters ([_]) have to be named so that the alias can pass + them on to the item it aliases. *) + let alias_params params = + List.split + (List.mapi + (fun i (p : TypeDecl.param) -> + let v = match p.desc with Var v -> v | Any -> Printf.sprintf "a%d" i in + ({ p with TypeDecl.desc = TypeDecl.Var v }, TypeExpr.Var v)) + params) + in let rec wrapper_item item acc = match (item : Signature.item) with | Type (rec_, td) -> + let params, args = alias_params td.equation.params in + let manifest = + Some (TypeExpr.Constr (`Identifier ((td.id :> Id.Path.Type.t), false), args)) + in + let equation = + { td.equation with TypeDecl.Equation.params; manifest; constraints = []; private_ = false } + in let id = Id.Mk.type_ (parent, Odoc_model.Names.TypeName.make_std (name td.id)) in - Signature.Type (rec_, { td with TypeDecl.id; representation = None; canonical = None; source_loc = None }) :: acc + Signature.Type (rec_, { td with TypeDecl.id; equation; representation = None; canonical = None; source_loc = None }) :: acc | Module (rec_, m) -> let id = Id.Mk.module_ (parent, Odoc_model.Names.ModuleName.make_std (name m.id)) in - Signature.Module (rec_, { m with Module.id; canonical = None; hidden = false; source_loc = None }) :: acc + let type_ = Module.Alias (`Identifier ((m.id :> Id.Path.Module.t), false), None) in + Signature.Module (rec_, { m with Module.id; type_; canonical = None; hidden = false; source_loc = None }) :: acc | ModuleType mt -> let id = Id.Mk.module_type (parent, Odoc_model.Names.ModuleTypeName.make_std (name mt.id)) in - Signature.ModuleType { mt with ModuleType.id; canonical = None; source_loc = None } :: acc + let expr = + Some (ModuleType.Path { p_path = `Identifier ((mt.id :> Id.Path.ModuleType.t), false); p_expansion = None }) + in + Signature.ModuleType { mt with ModuleType.id; expr; canonical = None; source_loc = None } :: acc | Include incl -> (* The items an [include] brings in are visible to the functor too. *) List.fold_left (fun acc item -> wrapper_item item acc) acc incl.Include.expansion.content.items | Value _ | ModuleSubstitution _ | ModuleTypeSubstitution _ | Open _ - | TypeSubstitution _ | TypExt _ | Exception _ | Comment _ - | Class _ | ClassType _ -> + | TypeSubstitution _ | TypExt _ | Exception _ | Comment _ -> (* Nothing in the expansion of [F(BODY__n)] can refer to these. *) acc + | Class _ | ClassType _ -> + (* A class type of the argument can be referred to from the expansion, + but odoc does not chase class type aliases the way it chases type + manifests, so aliasing them here would not help: such a reference is + left printing the (hidden) name of the synthetic module. *) + acc in List.rev (List.fold_left (fun acc item -> wrapper_item item acc) [] items) diff --git a/src/loader/cmi.mli b/src/loader/cmi.mli index 563bcd57c5..df2f261341 100644 --- a/src/loader/cmi.mli +++ b/src/loader/cmi.mli @@ -137,5 +137,7 @@ val wrapper_module : Odoc_model.Lang.Signature.item list -> Odoc_model.Lang.Signature.item (** [wrapper_module w ~hidden items] is the synthetic module an - [include functor] applies its functor to: a hidden module holding [items], - which are the items that precede the include. *) + [include functor] applies its functor to. Its items are aliases of + [items], the items that precede the include, so that whatever the functor's + expansion inherits from its argument resolves back to them rather than to + the (hidden) name of the wrapper. *) diff --git a/test/generators/html/Oxcaml-Include_functor.html b/test/generators/html/Oxcaml-Include_functor.html index 594d713c26..a5fdf4f742 100644 --- a/test/generators/html/Oxcaml-Include_functor.html +++ b/test/generators/html/Oxcaml-Include_functor.html @@ -56,7 +56,9 @@

    Module Oxcaml.Include_functor

    - type included + type included + = t +
    diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html deleted file mode 100644 index 7740b73965..0000000000 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - Reexported (Oxcaml.Include_functor_argument_shapes.Reexported) - - - - - - - - -
    -

    Module type - Include_functor_argument_shapes.Reexported -

    A module type of the argument, aliased as a path to it.

    -
    -
    -
    -
    - - type u -
    -
    -
    - - diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html index 59fd2847ee..2be2565523 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html @@ -124,7 +124,9 @@

    Module
    - type included + type included + = t +

    No parameters, so the alias odoc puts in the synthetic module @@ -135,7 +137,9 @@

    Module
    - type applied + type applied + = int p +

    A named parameter, which the alias threads through as @@ -146,7 +150,9 @@

    Module
    - type anonymous + type anonymous + = bool anon +

    An anonymous parameter: _ gives the alias no name @@ -159,6 +165,10 @@

    Module
    type from_module + = + X.v + +
    @@ -172,14 +182,12 @@

    Module module - type - Reexported - + type Reexported - = sig ... - end + = + + S +

    diff --git a/test/generators/html/Oxcaml-Include_functor_named_type.html b/test/generators/html/Oxcaml-Include_functor_named_type.html index 794abf1df3..6dfd6f4792 100644 --- a/test/generators/html/Oxcaml-Include_functor_named_type.html +++ b/test/generators/html/Oxcaml-Include_functor_named_type.html @@ -65,7 +65,9 @@

    Module Oxcaml.Include_functor_named_type
    - type included + type included + = t +
    diff --git a/test/generators/html/Oxcaml-Include_functor_not_last.html b/test/generators/html/Oxcaml-Include_functor_not_last.html index 54b98915b1..7e67651495 100644 --- a/test/generators/html/Oxcaml-Include_functor_not_last.html +++ b/test/generators/html/Oxcaml-Include_functor_not_last.html @@ -58,7 +58,9 @@

    Module Oxcaml.Include_functor_not_last

    - type included + type included + = t +
    diff --git a/test/generators/html/Oxcaml-Multiple_include_functors.html b/test/generators/html/Oxcaml-Multiple_include_functors.html index b31963ec4e..db22b07e2b 100644 --- a/test/generators/html/Oxcaml-Multiple_include_functors.html +++ b/test/generators/html/Oxcaml-Multiple_include_functors.html @@ -74,7 +74,9 @@

    Module Oxcaml.Multiple_include_functors

    - type first + type first + = t +
    @@ -100,14 +102,16 @@

    Module Oxcaml.Multiple_include_functors

    type second - = t + = first
    - type third + type third + = between +
    diff --git a/test/generators/html/Oxcaml_impl-Anonymous_functor.html b/test/generators/html/Oxcaml_impl-Anonymous_functor.html index 8ee25bbc00..441c2f315c 100644 --- a/test/generators/html/Oxcaml_impl-Anonymous_functor.html +++ b/test/generators/html/Oxcaml_impl-Anonymous_functor.html @@ -47,7 +47,9 @@

    Module Oxcaml_impl.Anonymous_functor

    - type included + type included + = t +
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor.html b/test/generators/html/Oxcaml_impl-Include_functor.html index 68e9061edc..ca8eeeda76 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor.html +++ b/test/generators/html/Oxcaml_impl-Include_functor.html @@ -57,7 +57,9 @@

    Module Oxcaml_impl.Include_functor

    - type included + type included + = t +
    diff --git a/test/generators/html/Oxcaml_impl-Include_functor_not_last.html b/test/generators/html/Oxcaml_impl-Include_functor_not_last.html index df41eb1ed0..8f73144085 100644 --- a/test/generators/html/Oxcaml_impl-Include_functor_not_last.html +++ b/test/generators/html/Oxcaml_impl-Include_functor_not_last.html @@ -59,7 +59,9 @@

    Module Oxcaml_impl.Include_functor_not_last
    - type included + type included + = t +
    diff --git a/test/generators/html/Oxcaml_impl-Multiple_include_functors.html b/test/generators/html/Oxcaml_impl-Multiple_include_functors.html index 67712b45de..86390cc038 100644 --- a/test/generators/html/Oxcaml_impl-Multiple_include_functors.html +++ b/test/generators/html/Oxcaml_impl-Multiple_include_functors.html @@ -78,7 +78,9 @@

    Module Oxcaml_impl.Multiple_include_functors
    - type first + type first + = t +
    @@ -103,14 +105,16 @@

    Module Oxcaml_impl.Multiple_include_functors
    type second - = t + = first

    - type third + type third + = between +
    diff --git a/test/generators/html/Oxcaml_impl-Resolve_functor-M.html b/test/generators/html/Oxcaml_impl-Resolve_functor-M.html index 7db2b44653..ddbee83d88 100644 --- a/test/generators/html/Oxcaml_impl-Resolve_functor-M.html +++ b/test/generators/html/Oxcaml_impl-Resolve_functor-M.html @@ -39,7 +39,7 @@

    Module Resolve_functor.M

    type myt - = float + = t
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index 1558321adc..97efa52fb5 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -23,7 +23,6 @@ Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html Oxcaml-Include_functor_argument_shapes-X.html Oxcaml-Include_functor_argument_shapes-module-type-S.html -Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html Oxcaml-Include_functor_desugared.html Oxcaml-Include_functor_desugared-Make.html Oxcaml-Include_functor_desugared-Make-argument-1-T.html diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 05857dea83..4ba9807318 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -407,7 +407,7 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \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} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor--type-t]{\ocamlinlinecode{t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Include_functor_argument_shapes}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}argument\_\allowbreak{}shapes}}}\label{Oxcaml-Include_functor_argument_shapes}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes--module-type-Arg}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg]{\ocamlinlinecode{Arg}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ @@ -430,17 +430,15 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \label{Oxcaml-Include_functor_argument_shapes--module-type-S}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-S]{\ocamlinlinecode{S}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-S}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-S--type-u}\ocamlcodefragment{\ocamltag{keyword}{type} u}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor_argument_shapes-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_argument_shapes--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\begin{ocamlindent}No parameters, so the alias odoc puts in the synthetic module is a bare \ocamlinlinecode{type t = t}.\end{ocamlindent}% +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor_argument_shapes-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_argument_shapes--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_argument_shapes--type-t]{\ocamlinlinecode{t}}}\begin{ocamlindent}No parameters, so the alias odoc puts in the synthetic module is a bare \ocamlinlinecode{type t = t}.\end{ocamlindent}% \medbreak -\label{Oxcaml-Include_functor_argument_shapes--type-applied}\ocamlcodefragment{\ocamltag{keyword}{type} applied}\begin{ocamlindent}A named parameter, which the alias threads through as \ocamlinlinecode{type 'a p = 'a p}.\end{ocamlindent}% +\label{Oxcaml-Include_functor_argument_shapes--type-applied}\ocamlcodefragment{\ocamltag{keyword}{type} applied = int \hyperref[Oxcaml-Include_functor_argument_shapes--type-p]{\ocamlinlinecode{p}}}\begin{ocamlindent}A named parameter, which the alias threads through as \ocamlinlinecode{type 'a p = 'a p}.\end{ocamlindent}% \medbreak -\label{Oxcaml-Include_functor_argument_shapes--type-anonymous}\ocamlcodefragment{\ocamltag{keyword}{type} anonymous}\begin{ocamlindent}An anonymous parameter: \ocamlinlinecode{\_\allowbreak{}} gives the alias no name to mention on the right, so one is invented, as \ocamlinlinecode{type 'a0 anon = 'a0 anon}.\end{ocamlindent}% +\label{Oxcaml-Include_functor_argument_shapes--type-anonymous}\ocamlcodefragment{\ocamltag{keyword}{type} anonymous = bool \hyperref[Oxcaml-Include_functor_argument_shapes--type-anon]{\ocamlinlinecode{anon}}}\begin{ocamlindent}An anonymous parameter: \ocamlinlinecode{\_\allowbreak{}} gives the alias no name to mention on the right, so one is invented, as \ocamlinlinecode{type 'a0 anon = 'a0 anon}.\end{ocamlindent}% \medbreak -\label{Oxcaml-Include_functor_argument_shapes--type-from_module}\ocamlcodefragment{\ocamltag{keyword}{type} from\_\allowbreak{}module}\begin{ocamlindent}Reached through a submodule of the argument, aliased as \ocamlinlinecode{module X = X}.\end{ocamlindent}% +\label{Oxcaml-Include_functor_argument_shapes--type-from_module}\ocamlcodefragment{\ocamltag{keyword}{type} from\_\allowbreak{}module = \hyperref[Oxcaml-Include_functor_argument_shapes-X--type-v]{\ocamlinlinecode{X.\allowbreak{}v}}}\begin{ocamlindent}Reached through a submodule of the argument, aliased as \ocamlinlinecode{module X = X}.\end{ocamlindent}% \medbreak -\label{Oxcaml-Include_functor_argument_shapes--module-type-Reexported}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Reexported]{\ocamlinlinecode{Reexported}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-Reexported}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-Reexported--type-u}\ocamlcodefragment{\ocamltag{keyword}{type} u}\\ -\end{ocamlindent}% -\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}A module type of the argument, aliased as a path to it.\end{ocamlindent}% +\label{Oxcaml-Include_functor_argument_shapes--module-type-Reexported}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} Reexported = \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-S]{\ocamlinlinecode{S}}}\begin{ocamlindent}A module type of the argument, aliased as a path to it.\end{ocamlindent}% \medbreak \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ @@ -473,7 +471,7 @@ \subsubsection{Signature\label{Oxcaml-Include_functor_named_type-module-type-Mak \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}This is a module where the functor 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-MakeType]{\ocamlinlinecode{MakeType}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml-Include_functor_named_type-module-type-MakeType]{\ocamlinlinecode{MakeType}}\label{Oxcaml-Include_functor_named_type--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_named_type--type-t]{\ocamlinlinecode{t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Include_functor_inline}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_inline]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}inline}}}\label{Oxcaml-Include_functor_inline}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_inline--module-type-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_inline-module-type-Make]{\ocamlinlinecode{Make}}}\label{Oxcaml-Include_functor_inline-module-type-Make}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\subsubsection{Parameters\label{Oxcaml-Include_functor_inline-module-type-Make--parameters_8}}% @@ -502,16 +500,16 @@ \subsubsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--s \medbreak \label{Oxcaml-Multiple_include_functors--module-Second}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Multiple_include_functors-Second-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ \label{Oxcaml-Multiple_include_functors--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-First]{\ocamlinlinecode{First}}\label{Oxcaml-Multiple_include_functors--type-first}\ocamlcodefragment{\ocamltag{keyword}{type} first}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-First]{\ocamlinlinecode{First}}\label{Oxcaml-Multiple_include_functors--type-first}\ocamlcodefragment{\ocamltag{keyword}{type} first = \hyperref[Oxcaml-Multiple_include_functors--type-t]{\ocamlinlinecode{t}}}\\ \label{Oxcaml-Multiple_include_functors--type-between}\ocamlcodefragment{\ocamltag{keyword}{type} between}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[Oxcaml-Multiple_include_functors--type-t]{\ocamlinlinecode{t}}}\\ -\label{Oxcaml-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[Oxcaml-Multiple_include_functors--type-first]{\ocamlinlinecode{first}}}\\ +\label{Oxcaml-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third = \hyperref[Oxcaml-Multiple_include_functors--type-between]{\ocamlinlinecode{between}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Include_functor_not_last}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_not_last]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}not\_\allowbreak{}last}}}\label{Oxcaml-Include_functor_not_last}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_not_last--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_not_last-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}An \ocamlinlinecode{include functor} that is not the last item of the signature.\end{ocamlindent}% \medbreak \label{Oxcaml-Include_functor_not_last--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_not_last--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_not_last--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_not_last--type-t]{\ocamlinlinecode{t}}}\\ \label{Oxcaml-Include_functor_not_last--type-after}\ocamlcodefragment{\ocamltag{keyword}{type} after}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ diff --git a/test/generators/latex/Oxcaml_impl.tex b/test/generators/latex/Oxcaml_impl.tex index 048e1a2493..2d6d75e5dd 100644 --- a/test/generators/latex/Oxcaml_impl.tex +++ b/test/generators/latex/Oxcaml_impl.tex @@ -48,7 +48,7 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \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 demonstrates the \ocamlinlinecode{include functor} functionality. \ocamlinlinecode{Make} uses its argument, so \ocamlinlinecode{included} has to come out equal to \ocamlinlinecode{t} rather than abstract.\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}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Include_functor-Make]{\ocamlinlinecode{Make}}\label{Oxcaml_impl-Include_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-Include_functor--type-t]{\ocamlinlinecode{t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Include_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml_impl-Include_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Include_functor_desugared--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_desugared-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Include_functor_desugared-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 is the desugared version from above\end{ocamlindent}% @@ -59,7 +59,7 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Resolve_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor]{\ocamlinlinecode{Resolve\_\allowbreak{}functor}}}\label{Oxcaml_impl-Resolve_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor--module-F}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Resolve_functor-F-argument-1-I]{\ocamlinlinecode{I}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ \label{Oxcaml_impl-Resolve_functor--module-M}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Resolve_functor-M]{\ocamlinlinecode{M}}}\label{Oxcaml_impl-Resolve_functor-M}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Resolve_functor-M--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t = float}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}\label{Oxcaml_impl-Resolve_functor-M--type-myt}\ocamlcodefragment{\ocamltag{keyword}{type} myt = float}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Resolve_functor-F]{\ocamlinlinecode{F}}\label{Oxcaml_impl-Resolve_functor-M--type-myt}\ocamlcodefragment{\ocamltag{keyword}{type} myt = \hyperref[Oxcaml_impl-Resolve_functor-M--type-t]{\ocamlinlinecode{t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \end{ocamlindent}% @@ -68,22 +68,22 @@ \subsection{Include functor on structures\label{Oxcaml_impl--include-functor-on- \medbreak \label{Oxcaml_impl-Multiple_include_functors--module-Second}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Multiple_include_functors-Second-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ \label{Oxcaml_impl-Multiple_include_functors--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-First]{\ocamlinlinecode{First}}\label{Oxcaml_impl-Multiple_include_functors--type-first}\ocamlcodefragment{\ocamltag{keyword}{type} first}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-First]{\ocamlinlinecode{First}}\label{Oxcaml_impl-Multiple_include_functors--type-first}\ocamlcodefragment{\ocamltag{keyword}{type} first = \hyperref[Oxcaml_impl-Multiple_include_functors--type-t]{\ocamlinlinecode{t}}}\\ \label{Oxcaml_impl-Multiple_include_functors--type-between}\ocamlcodefragment{\ocamltag{keyword}{type} between}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml_impl-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[Oxcaml_impl-Multiple_include_functors--type-t]{\ocamlinlinecode{t}}}\\ -\label{Oxcaml_impl-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Multiple_include_functors-Second]{\ocamlinlinecode{Second}}\label{Oxcaml_impl-Multiple_include_functors--type-second}\ocamlcodefragment{\ocamltag{keyword}{type} second = \hyperref[Oxcaml_impl-Multiple_include_functors--type-first]{\ocamlinlinecode{first}}}\\ +\label{Oxcaml_impl-Multiple_include_functors--type-third}\ocamlcodefragment{\ocamltag{keyword}{type} third = \hyperref[Oxcaml_impl-Multiple_include_functors--type-between]{\ocamlinlinecode{between}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Include_functor_not_last}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_not_last]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}not\_\allowbreak{}last}}}\label{Oxcaml_impl-Include_functor_not_last}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Include_functor_not_last--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml_impl-Include_functor_not_last-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}An \ocamlinlinecode{include functor} that is not the last item of the structure.\end{ocamlindent}% \medbreak \label{Oxcaml_impl-Include_functor_not_last--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ -\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}\label{Oxcaml_impl-Include_functor_not_last--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\ocamltag{keyword}{include functor} \hyperref[Oxcaml_impl-Include_functor_not_last-Make]{\ocamlinlinecode{Make}}\label{Oxcaml_impl-Include_functor_not_last--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-Include_functor_not_last--type-t]{\ocamlinlinecode{t}}}\\ \label{Oxcaml_impl-Include_functor_not_last--type-after}\ocamlcodefragment{\ocamltag{keyword}{type} after = string}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml_impl--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml_impl-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml_impl-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml_impl-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every \ocamlinlinecode{include functor} in a signature.\end{ocamlindent}% \medbreak -\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml_impl-Anonymous_functor-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml_impl-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml_impl-Anonymous_functor-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml_impl-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml_impl-Anonymous_functor--type-t]{\ocamlinlinecode{t}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index b22b3eba26..16d390567a 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11972,7 +11972,6 @@ Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html.gen Oxcaml-Include_functor_argument_shapes-X.html.gen Oxcaml-Include_functor_argument_shapes-module-type-S.html.gen - Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html.gen Oxcaml-Include_functor_desugared.html.gen Oxcaml-Include_functor_desugared-Make.html.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.html.gen @@ -12186,14 +12185,6 @@ Oxcaml-Include_functor_argument_shapes-module-type-S.html Oxcaml-Include_functor_argument_shapes-module-type-S.html.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html - Oxcaml-Include_functor_argument_shapes-module-type-Reexported.html.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12714,7 +12705,6 @@ Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md.gen Oxcaml-Include_functor_argument_shapes-X.md.gen Oxcaml-Include_functor_argument_shapes-module-type-S.md.gen - Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md.gen Oxcaml-Include_functor_desugared.md.gen Oxcaml-Include_functor_desugared-Make.md.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.md.gen @@ -12920,14 +12910,6 @@ Oxcaml-Include_functor_argument_shapes-module-type-S.md Oxcaml-Include_functor_argument_shapes-module-type-S.md.gen)) (enabled_if %{ocaml-config:ox})) - (rule - (alias runtest) - (package odoc) - (action - (diff - Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md - Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md.gen)) - (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) diff --git a/test/generators/man/Oxcaml.Include_functor.3o b/test/generators/man/Oxcaml.Include_functor.3o index a0776f720c..1b7792e54d 100644 --- a/test/generators/man/Oxcaml.Include_functor.3o +++ b/test/generators/man/Oxcaml.Include_functor.3o @@ -20,4 +20,4 @@ Module which defines a functor and includes it via module type of .sp \f[CB]type\fR t .sp -\f[CB]type\fR included +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o index 43e5587ae8..9ef30a8eb3 100644 --- a/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o @@ -58,40 +58,35 @@ Everything the expansion of the functor can inherit from its argument: types, in .br \f[CB]end\fR .sp -\f[CB]type\fR included +\f[CB]type\fR included = t .fi .br .ti +2 No parameters, so the alias odoc puts in the synthetic module is a bare type t = t\. .nf .sp -\f[CB]type\fR applied +\f[CB]type\fR applied = int p .fi .br .ti +2 A named parameter, which the alias threads through as type 'a p = 'a p\. .nf .sp -\f[CB]type\fR anonymous +\f[CB]type\fR anonymous = bool anon .fi .br .ti +2 An anonymous parameter: _ gives the alias no name to mention on the right, so one is invented, as type 'a0 anon = 'a0 anon\. .nf .sp -\f[CB]type\fR from_module +\f[CB]type\fR from_module = X\.v .fi .br .ti +2 Reached through a submodule of the argument, aliased as module X = X\. .nf .sp -\f[CB]module\fR \f[CB]type\fR Reexported = \f[CB]sig\fR -.br -.ti +2 -\f[CB]type\fR u -.br -\f[CB]end\fR +\f[CB]module\fR \f[CB]type\fR Reexported = S .fi .br .ti +2 diff --git a/test/generators/man/Oxcaml.Include_functor_named_type.3o b/test/generators/man/Oxcaml.Include_functor_named_type.3o index d507cd1cdf..ad1261577e 100644 --- a/test/generators/man/Oxcaml.Include_functor_named_type.3o +++ b/test/generators/man/Oxcaml.Include_functor_named_type.3o @@ -42,4 +42,4 @@ This is a module where the functor is named and then included\. .sp \f[CB]type\fR t .sp -\f[CB]type\fR included +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml.Include_functor_not_last.3o b/test/generators/man/Oxcaml.Include_functor_not_last.3o index 8a7a26ab79..fdcbacd519 100644 --- a/test/generators/man/Oxcaml.Include_functor_not_last.3o +++ b/test/generators/man/Oxcaml.Include_functor_not_last.3o @@ -20,6 +20,6 @@ An include functor that is not the last item of the signature\. .sp \f[CB]type\fR t .sp -\f[CB]type\fR included +\f[CB]type\fR included = t .sp \f[CB]type\fR after diff --git a/test/generators/man/Oxcaml.Multiple_include_functors.3o b/test/generators/man/Oxcaml.Multiple_include_functors.3o index 03692ad7fc..7050c458fd 100644 --- a/test/generators/man/Oxcaml.Multiple_include_functors.3o +++ b/test/generators/man/Oxcaml.Multiple_include_functors.3o @@ -22,10 +22,10 @@ Two include functors in the same signature, with an item defined between them\. .sp \f[CB]type\fR t .sp -\f[CB]type\fR first +\f[CB]type\fR first = t .sp \f[CB]type\fR between .sp -\f[CB]type\fR second = t +\f[CB]type\fR second = first .sp -\f[CB]type\fR third +\f[CB]type\fR third = between diff --git a/test/generators/man/Oxcaml_impl.Anonymous_functor.3o b/test/generators/man/Oxcaml_impl.Anonymous_functor.3o index 6cd82e6a99..7d1a842062 100644 --- a/test/generators/man/Oxcaml_impl.Anonymous_functor.3o +++ b/test/generators/man/Oxcaml_impl.Anonymous_functor.3o @@ -18,4 +18,4 @@ Oxcaml_impl\.Anonymous_functor The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every include functor in a signature\. .nf .sp -\f[CB]type\fR included +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml_impl.Include_functor.3o b/test/generators/man/Oxcaml_impl.Include_functor.3o index 1478dce3b8..552907cc2c 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor.3o @@ -20,4 +20,4 @@ This module demonstrates the include functor functionality\. Make uses its argum .sp \f[CB]type\fR t .sp -\f[CB]type\fR included +\f[CB]type\fR included = t diff --git a/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o b/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o index 5798e72293..f6dc22868a 100644 --- a/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o +++ b/test/generators/man/Oxcaml_impl.Include_functor_not_last.3o @@ -20,6 +20,6 @@ An include functor that is not the last item of the structure\. .sp \f[CB]type\fR t .sp -\f[CB]type\fR included +\f[CB]type\fR included = t .sp \f[CB]type\fR after = string diff --git a/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o b/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o index 4c9a33867e..f878bf454c 100644 --- a/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o +++ b/test/generators/man/Oxcaml_impl.Multiple_include_functors.3o @@ -22,10 +22,10 @@ Two include functors in the same structure, with an item defined between them\. .sp \f[CB]type\fR t .sp -\f[CB]type\fR first +\f[CB]type\fR first = t .sp \f[CB]type\fR between .sp -\f[CB]type\fR second = t +\f[CB]type\fR second = first .sp -\f[CB]type\fR third +\f[CB]type\fR third = between diff --git a/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o b/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o index c4abc30f4a..5d2b52ffa2 100644 --- a/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o +++ b/test/generators/man/Oxcaml_impl.Resolve_functor.M.3o @@ -13,4 +13,4 @@ Oxcaml_impl\.Resolve_functor\.M .nf \f[CB]type\fR t = float .sp -\f[CB]type\fR myt = float +\f[CB]type\fR myt = t diff --git a/test/generators/markdown/Oxcaml-Include_functor.md b/test/generators/markdown/Oxcaml-Include_functor.md index e54338a324..5b0c66c8d8 100644 --- a/test/generators/markdown/Oxcaml-Include_functor.md +++ b/test/generators/markdown/Oxcaml-Include_functor.md @@ -10,5 +10,5 @@ Module which defines a functor and includes it via `module type of` type t ``` ```ocaml -type included +type included = t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md deleted file mode 100644 index 69e689c4a9..0000000000 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md +++ /dev/null @@ -1,8 +0,0 @@ - -# Module type `Include_functor_argument_shapes.Reexported` - -A module type of the argument, aliased as a path to it. - -```ocaml -type u -``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md index 901d262b4d..064cb24d76 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md @@ -25,26 +25,26 @@ module X : sig ... end module type S = sig ... end ``` ```ocaml -type included +type included = t ``` No parameters, so the alias odoc puts in the synthetic module is a bare `type t = t`. ```ocaml -type applied +type applied = int p ``` A named parameter, which the alias threads through as `type 'a p = 'a p`. ```ocaml -type anonymous +type anonymous = bool anon ``` An anonymous parameter: `_` gives the alias no name to mention on the right, so one is invented, as `type 'a0 anon = 'a0 anon`. ```ocaml -type from_module +type from_module = X.v ``` Reached through a submodule of the argument, aliased as `module X = X`. ```ocaml -module type Reexported = sig ... end +module type Reexported = S ``` A module type of the argument, aliased as a path to it. diff --git a/test/generators/markdown/Oxcaml-Include_functor_named_type.md b/test/generators/markdown/Oxcaml-Include_functor_named_type.md index 15e36a2472..eff2fe5acd 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_named_type.md +++ b/test/generators/markdown/Oxcaml-Include_functor_named_type.md @@ -10,5 +10,5 @@ This is a module where the functor is named and then included. type t ``` ```ocaml -type included +type included = t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_not_last.md b/test/generators/markdown/Oxcaml-Include_functor_not_last.md index 39df233d4d..3d9f8922cf 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_not_last.md +++ b/test/generators/markdown/Oxcaml-Include_functor_not_last.md @@ -10,7 +10,7 @@ An `include functor` that is not the last item of the signature. type t ``` ```ocaml -type included +type included = t ``` ```ocaml type after diff --git a/test/generators/markdown/Oxcaml-Multiple_include_functors.md b/test/generators/markdown/Oxcaml-Multiple_include_functors.md index 92845bdfeb..1adc7aeb97 100644 --- a/test/generators/markdown/Oxcaml-Multiple_include_functors.md +++ b/test/generators/markdown/Oxcaml-Multiple_include_functors.md @@ -13,14 +13,14 @@ module Second (T : sig ... end) : sig ... end type t ``` ```ocaml -type first +type first = t ``` ```ocaml type between ``` ```ocaml -type second = t +type second = first ``` ```ocaml -type third +type third = between ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md b/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md index 906bf468f1..75a850a90f 100644 --- a/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md +++ b/test/generators/markdown/Oxcaml_impl-Anonymous_functor.md @@ -7,5 +7,5 @@ type t The functor is defined inline, so there is no path for odoc to apply: it has to bind the functor to a module first, as it does for every `include functor` in a signature. ```ocaml -type included +type included = t ``` \ 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 index 1c483719dd..bb0ee68f05 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor.md @@ -10,5 +10,5 @@ This module demonstrates the `include functor` functionality. `Make` uses its ar type t ``` ```ocaml -type included +type included = t ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md index af234557dc..4350327ba0 100644 --- a/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md +++ b/test/generators/markdown/Oxcaml_impl-Include_functor_not_last.md @@ -10,7 +10,7 @@ An `include functor` that is not the last item of the structure. type t ``` ```ocaml -type included +type included = t ``` ```ocaml type after = string diff --git a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md index c076eb2b8f..6091459a92 100644 --- a/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md +++ b/test/generators/markdown/Oxcaml_impl-Multiple_include_functors.md @@ -13,14 +13,14 @@ module Second (T : sig ... end) : sig ... end type t ``` ```ocaml -type first +type first = t ``` ```ocaml type between ``` ```ocaml -type second = t +type second = first ``` ```ocaml -type third +type third = between ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md b/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md index d724ddfc90..c76201db55 100644 --- a/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md +++ b/test/generators/markdown/Oxcaml_impl-Resolve_functor-M.md @@ -5,5 +5,5 @@ type t = float ``` ```ocaml -type myt = float +type myt = t ``` \ No newline at end of file diff --git a/test/generators/markdown/oxcaml.targets b/test/generators/markdown/oxcaml.targets index f570412fd1..ca56a378aa 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -23,7 +23,6 @@ Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md Oxcaml-Include_functor_argument_shapes-X.md Oxcaml-Include_functor_argument_shapes-module-type-S.md -Oxcaml-Include_functor_argument_shapes-module-type-Reexported.md Oxcaml-Include_functor_desugared.md Oxcaml-Include_functor_desugared-Make.md Oxcaml-Include_functor_desugared-Make-argument-1-T.md From e3c4b33f2d3ae45dabd8d78843aa3cbb2fb52d82 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Mon, 31 Aug 2026 16:01:17 +0200 Subject: [PATCH 20/23] Add examples where the module body has an include --- test/generators/cases/oxcaml.mli | 14 ++++++++++++++ .../html/Oxcaml-Anonymous_functor.html | 4 ++-- ...nctor_argument_shapes-Make-argument-1-T.html | 17 +++++++++++++++++ ...functor_argument_shapes-module-type-Arg.html | 17 +++++++++++++++++ .../Oxcaml-Include_functor_argument_shapes.html | 17 +++++++++++++++++ test/generators/latex/Oxcaml.tex | 6 +++++- .../Oxcaml.Include_functor_argument_shapes.3o | 10 ++++++++++ ...caml.Include_functor_argument_shapes.Make.3o | 6 ++++++ ...functor_argument_shapes-Make-argument-1-T.md | 6 ++++++ ...e_functor_argument_shapes-module-type-Arg.md | 6 ++++++ .../Oxcaml-Include_functor_argument_shapes.md | 6 ++++++ 11 files changed, 106 insertions(+), 3 deletions(-) diff --git a/test/generators/cases/oxcaml.mli b/test/generators/cases/oxcaml.mli index 5c82e6fea9..c81169aa1f 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -549,6 +549,8 @@ module Include_functor_argument_shapes : sig type _ anon module X : sig type v end module type S + val via_module_type_include : unit + val via_module_include : unit end module Make (T : Arg) : sig @@ -572,11 +574,23 @@ module Include_functor_argument_shapes : sig (** A module type of the argument, aliased as a path to it. *) end + (**/**) + module type To_include_module_type = sig + val via_module_type_include : unit + end + + module To_include_module : sig + val via_module_include : unit + end + (**/**) + type t type 'a p type _ anon module X : sig type v end module type S = sig type u end + include To_include_module_type + include module type of To_include_module include functor module type of Make end diff --git a/test/generators/html/Oxcaml-Anonymous_functor.html b/test/generators/html/Oxcaml-Anonymous_functor.html index b42ee26901..7179fdc3a4 100644 --- a/test/generators/html/Oxcaml-Anonymous_functor.html +++ b/test/generators/html/Oxcaml-Anonymous_functor.html @@ -32,8 +32,8 @@

    Module Oxcaml.Anonymous_functor

    include functor functor ( - T - : sig ... + T + : sig ... end) -> sig ... diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html index 2bcd2843a9..b5b1b82051 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html @@ -68,6 +68,23 @@

    Parameter Make.T

    +
    +
    + + + val via_module_type_include : unit + + +
    +
    +
    +
    + + + val via_module_include : unit + +
    +
    diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html index 4719ea11f2..9627fbc9bf 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html @@ -72,6 +72,23 @@

    Module type

    +
    +
    + + + val via_module_type_include : unit + + +
    +
    +
    +
    + + + val via_module_include : unit + +
    +
    diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html index 2be2565523..14752db5d7 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html @@ -110,6 +110,23 @@

    Module

    +
    +
    + + + val via_module_type_include : unit + + +
    +
    +
    +
    + + + val via_module_include : unit + +
    +
    diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 4ba9807318..0078f37efc 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -417,6 +417,8 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--module-type-S}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} S}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--val-via_module_type_include}\ocamlcodefragment{\ocamltag{keyword}{val} via\_\allowbreak{}module\_\allowbreak{}type\_\allowbreak{}include : unit}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--val-via_module_include}\ocamlcodefragment{\ocamltag{keyword}{val} via\_\allowbreak{}module\_\allowbreak{}include : unit}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types.\end{ocamlindent}% \medbreak @@ -430,6 +432,8 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \label{Oxcaml-Include_functor_argument_shapes--module-type-S}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-S]{\ocamlinlinecode{S}}}\label{Oxcaml-Include_functor_argument_shapes-module-type-S}\ocamlcodefragment{ = \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_argument_shapes-module-type-S--type-u}\ocamlcodefragment{\ocamltag{keyword}{type} u}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ +\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_argument_shapes--val-via_module_type_include}\ocamlcodefragment{\ocamltag{keyword}{val} via\_\allowbreak{}module\_\allowbreak{}type\_\allowbreak{}include : unit}\\ +\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Include_functor_argument_shapes--val-via_module_include}\ocamlcodefragment{\ocamltag{keyword}{val} via\_\allowbreak{}module\_\allowbreak{}include : unit}\\ \ocamltag{keyword}{include functor} \ocamltag{keyword}{module} \ocamltag{keyword}{type} \ocamltag{keyword}{of} \hyperref[Oxcaml-Include_functor_argument_shapes-Make]{\ocamlinlinecode{Make}}\label{Oxcaml-Include_functor_argument_shapes--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included = \hyperref[Oxcaml-Include_functor_argument_shapes--type-t]{\ocamlinlinecode{t}}}\begin{ocamlindent}No parameters, so the alias odoc puts in the synthetic module is a bare \ocamlinlinecode{type t = t}.\end{ocamlindent}% \medbreak \label{Oxcaml-Include_functor_argument_shapes--type-applied}\ocamlcodefragment{\ocamltag{keyword}{type} applied = int \hyperref[Oxcaml-Include_functor_argument_shapes--type-p]{\ocamlinlinecode{p}}}\begin{ocamlindent}A named parameter, which the alias threads through as \ocamlinlinecode{type 'a p = 'a p}.\end{ocamlindent}% @@ -489,7 +493,7 @@ \subsubsection{Signature\label{Oxcaml-Include_functor_inline-module-type-Make--s \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Anonymous_functor}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor}}}\label{Oxcaml-Anonymous_functor}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Anonymous_functor--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\begin{ocamlindent}In this test case the functor is defined inline\end{ocamlindent}% \medbreak -\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml-Anonymous_functor-include9_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ +\ocamltag{keyword}{include functor} \ocamltag{keyword}{functor} (\hyperref[Oxcaml-Anonymous_functor-include11_-argument-1-T]{\ocamlinlinecode{T}} : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}) \ocamltag{arrow}{$\rightarrow$} \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}\label{Oxcaml-Anonymous_functor--type-included}\ocamlcodefragment{\ocamltag{keyword}{type} included}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Anonymous_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Anonymous_functor_desugared]{\ocamlinlinecode{Anonymous\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml-Anonymous_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\ocamltag{keyword}{include} .\allowbreak{}.\allowbreak{}.\allowbreak{}\label{Oxcaml-Anonymous_functor_desugared--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o index 9ef30a8eb3..e09f991b1a 100644 --- a/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o @@ -33,6 +33,12 @@ Oxcaml\.Include_functor_argument_shapes .sp .ti +2 \f[CB]module\fR \f[CB]type\fR S +.sp +.ti +2 +\f[CB]val\fR via_module_type_include : unit +.sp +.ti +2 +\f[CB]val\fR via_module_include : unit .br \f[CB]end\fR .fi @@ -58,6 +64,10 @@ Everything the expansion of the functor can inherit from its argument: types, in .br \f[CB]end\fR .sp +\f[CB]val\fR via_module_type_include : unit +.sp +\f[CB]val\fR via_module_include : unit +.sp \f[CB]type\fR included = t .fi .br diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o index a9a4c2ccd9..b998fa6a49 100644 --- a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o @@ -38,6 +38,12 @@ Oxcaml\.Include_functor_argument_shapes\.Make .sp .ti +2 \f[CB]module\fR \f[CB]type\fR S +.sp +.ti +2 +\f[CB]val\fR via_module_type_include : unit +.sp +.ti +2 +\f[CB]val\fR via_module_include : unit .br \f[CB]end\fR .sp diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md index 024823f8b8..638ea1c122 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md @@ -15,4 +15,10 @@ module X : sig ... end ``` ```ocaml module type S +``` +```ocaml +val via_module_type_include : unit +``` +```ocaml +val via_module_include : unit ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md index 560d4c293b..aab9997090 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md @@ -17,4 +17,10 @@ module X : sig ... end ``` ```ocaml module type S +``` +```ocaml +val via_module_type_include : unit +``` +```ocaml +val via_module_include : unit ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md index 064cb24d76..c09c55ea6c 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md @@ -25,6 +25,12 @@ module X : sig ... end module type S = sig ... end ``` ```ocaml +val via_module_type_include : unit +``` +```ocaml +val via_module_include : unit +``` +```ocaml type included = t ``` No parameters, so the alias odoc puts in the synthetic module is a bare `type t = t`. From c1d318d70ba1ca310a0c5022d1ceed689d013ea3 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Mon, 31 Aug 2026 16:18:47 +0200 Subject: [PATCH 21/23] Remove `partition_map` changes These were obsoleted by Jon's code and the PR pulled out of this was rejected so no need to keep them around. --- src/.ocamlformat-ignore | 2 +- src/utils/dune | 16 --------- src/utils/odoc_either.cppo.ml | 7 ---- src/utils/odoc_either.cppo.mli | 7 ---- src/utils/odoc_list.ml | 60 ++++++++++++---------------------- src/utils/odoc_utils.ml | 1 - 6 files changed, 22 insertions(+), 71 deletions(-) delete mode 100644 src/utils/odoc_either.cppo.ml delete mode 100644 src/utils/odoc_either.cppo.mli diff --git a/src/.ocamlformat-ignore b/src/.ocamlformat-ignore index fce093c531..84ee55fd90 100644 --- a/src/.ocamlformat-ignore +++ b/src/.ocamlformat-ignore @@ -16,4 +16,4 @@ odoc/*.cppo.ml html_support_files/*.ml xref2/shape_tools.* odoc/classify.cppo.ml -utils/*.cppo.ml* + diff --git a/src/utils/dune b/src/utils/dune index c975487e9d..0d749d5316 100644 --- a/src/utils/dune +++ b/src/utils/dune @@ -2,19 +2,3 @@ (name odoc_utils) (public_name odoc.odoc_utils) (libraries astring)) - -(rule - (deps - (:x odoc_either.cppo.ml)) - (action - (with-stdout-to - odoc_either.ml - (run %{bin:cppo} -V OCAML:%{ocaml_version} %{x})))) - -(rule - (deps - (:x odoc_either.cppo.mli)) - (action - (with-stdout-to - odoc_either.mli - (run %{bin:cppo} -V OCAML:%{ocaml_version} %{x})))) diff --git a/src/utils/odoc_either.cppo.ml b/src/utils/odoc_either.cppo.ml deleted file mode 100644 index 1913e81088..0000000000 --- a/src/utils/odoc_either.cppo.ml +++ /dev/null @@ -1,7 +0,0 @@ -#if OCAML_VERSION < (4, 12, 0) -type ('a, 'b) t = - | Left of 'a - | Right of 'b -#else -include Either -#endif diff --git a/src/utils/odoc_either.cppo.mli b/src/utils/odoc_either.cppo.mli deleted file mode 100644 index ab430baf9f..0000000000 --- a/src/utils/odoc_either.cppo.mli +++ /dev/null @@ -1,7 +0,0 @@ -#if OCAML_VERSION < (4, 12, 0) -type ('a, 'b) t = - | Left of 'a - | Right of 'b -#else -include module type of Either -#endif diff --git a/src/utils/odoc_list.ml b/src/utils/odoc_list.ml index 1ad3337a8a..057a243d77 100644 --- a/src/utils/odoc_list.ml +++ b/src/utils/odoc_list.ml @@ -1,3 +1,5 @@ +include List + let rec concat_map_sep ~sep ~f = function | [] -> [] | [ x ] -> f x @@ -6,12 +8,31 @@ let rec concat_map_sep ~sep ~f = function let tl = concat_map_sep ~sep ~f xs in hd @ (sep :: tl) +(* Since 4.10 *) +let concat_map f l = + let rec aux f acc = function + | [] -> rev acc + | x :: l -> + let xs = f x in + aux f (rev_append xs acc) l + in + aux f [] l + (** @raise Failure if the list is empty. *) let rec last = function | [] -> failwith "Odoc_utils.List.last" | [ x ] -> x | _ :: tl -> last tl +(* Since 4.10. Copied ocaml/ocaml *) +let rec find_map f = function + | [] -> None + | x :: l -> ( + match f x with Some _ as result -> result | None -> find_map f l) + +(* Since 5.1 *) +let is_empty = function [] -> true | _ :: _ -> false + let rec skip_until ~p = function | [] -> [] | h :: t -> if p h then t else skip_until ~p t @@ -23,42 +44,3 @@ let split_at ~f lst = | hd :: tl -> loop (hd :: acc) tl in loop [] lst - -module Overlay = struct - module Either = Odoc_either - - (* Since 4.12. Copied from ocaml/ocaml *) - let partition_map p l = - let rec part left right = function - | [] -> (List.rev left, List.rev right) - | x :: l -> ( - match p x with - | Either.Left v -> part (v :: left) right l - | Either.Right v -> part left (v :: right) l) - in - part [] [] l - - (* Since 5.1 *) - let is_empty = function [] -> true | _ :: _ -> false - - (* Since 4.10. Copied ocaml/ocaml *) - let rec find_map f = function - | [] -> None - | x :: l -> ( - match f x with Some _ as result -> result | None -> find_map f l) - - (* Since 4.10 *) - let concat_map f l = - let rec aux f acc = function - | [] -> List.rev acc - | x :: l -> - let xs = f x in - aux f (List.rev_append xs acc) l - in - aux f [] l - - (* shadow the functions defined above with the stdlib variants if available *) - include List -end - -include Overlay diff --git a/src/utils/odoc_utils.ml b/src/utils/odoc_utils.ml index cc5c113bee..4350c40b01 100644 --- a/src/utils/odoc_utils.ml +++ b/src/utils/odoc_utils.ml @@ -18,7 +18,6 @@ module OptionMonad = struct end module List = Odoc_list -module Either = Odoc_either module Tree = Tree module Forest = Tree.Forest From 1ccf92cc8131f63d29edc38a81ec0587cb08e614 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Thu, 3 Sep 2026 11:49:48 +0200 Subject: [PATCH 22/23] Move common code to `Cmti` --- src/loader/cmi.ml | 87 ------------------------------------------ src/loader/cmi.mli | 13 ------- src/loader/cmt.ml | 6 +-- src/loader/cmti.ml | 93 +++++++++++++++++++++++++++++++++++++++++++-- src/loader/cmti.mli | 17 +++++++++ 5 files changed, 110 insertions(+), 106 deletions(-) diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index 5e78da77ad..5a91f648c4 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -1638,90 +1638,3 @@ let read_interface root name ~warnings_tag intf = id intf in (id, items) - -let generate_wrapper_module = - let wrapper_counter = ref 0 in - fun parent ~prefix ~hidden -> - incr wrapper_counter; - let dummy_id = - let dummy_name = - let sep = match hidden with | true -> "__" | false -> "_" in - let name = Printf.sprintf "%s%s%d" prefix sep !wrapper_counter in - match hidden with - | false -> Odoc_model.Names.ModuleName.make_std name - | true -> Odoc_model.Names.ModuleName.hidden_of_string name - in - Identifier.Mk.module_ (parent, dummy_name) - in - let dummy_path = `Identifier (dummy_id, hidden) in - (dummy_id, dummy_path) - -let no_doc : Odoc_model.Comment.docs = { elements = []; warnings_tag = None } - -(* [include functor F] is modelled as the application of [F] to a synthetic, - hidden module holding the items that precede the include. - - That module's items are *aliases* of the real ones rather than copies: the - expansion of [F(BODY__n)] refers to the functor argument, so a copy would - leave the expansion mentioning [BODY__n.t], a hidden path, which the - generator renders as an abstract [type t]. With an alias, [BODY__n.t] - reduces to the enclosing signature's own [t] and is rendered, and linked, as - such. *) -let wrapper_items dummy_id items = - let module Id = Identifier in - let name id = Id.name id in - let parent = (dummy_id : Id.Module.t :> Id.Signature.t) in - (* Anonymous parameters ([_]) have to be named so that the alias can pass - them on to the item it aliases. *) - let alias_params params = - List.split - (List.mapi - (fun i (p : TypeDecl.param) -> - let v = match p.desc with Var v -> v | Any -> Printf.sprintf "a%d" i in - ({ p with TypeDecl.desc = TypeDecl.Var v }, TypeExpr.Var v)) - params) - in - let rec wrapper_item item acc = - match (item : Signature.item) with - | Type (rec_, td) -> - let params, args = alias_params td.equation.params in - let manifest = - Some (TypeExpr.Constr (`Identifier ((td.id :> Id.Path.Type.t), false), args)) - in - let equation = - { td.equation with TypeDecl.Equation.params; manifest; constraints = []; private_ = false } - in - let id = Id.Mk.type_ (parent, Odoc_model.Names.TypeName.make_std (name td.id)) in - Signature.Type (rec_, { td with TypeDecl.id; equation; representation = None; canonical = None; source_loc = None }) :: acc - | Module (rec_, m) -> - let id = Id.Mk.module_ (parent, Odoc_model.Names.ModuleName.make_std (name m.id)) in - let type_ = Module.Alias (`Identifier ((m.id :> Id.Path.Module.t), false), None) in - Signature.Module (rec_, { m with Module.id; type_; canonical = None; hidden = false; source_loc = None }) :: acc - | ModuleType mt -> - let id = Id.Mk.module_type (parent, Odoc_model.Names.ModuleTypeName.make_std (name mt.id)) in - let expr = - Some (ModuleType.Path { p_path = `Identifier ((mt.id :> Id.Path.ModuleType.t), false); p_expansion = None }) - in - Signature.ModuleType { mt with ModuleType.id; expr; canonical = None; source_loc = None } :: acc - | Include incl -> - (* The items an [include] brings in are visible to the functor too. *) - List.fold_left (fun acc item -> wrapper_item item acc) acc incl.Include.expansion.content.items - | Value _ | ModuleSubstitution _ | ModuleTypeSubstitution _ | Open _ - | TypeSubstitution _ | TypExt _ | Exception _ | Comment _ -> - (* Nothing in the expansion of [F(BODY__n)] can refer to these. *) - acc - | Class _ | ClassType _ -> - (* A class type of the argument can be referred to from the expansion, - but odoc does not chase class type aliases the way it chases type - manifests, so aliasing them here would not help: such a reference is - left printing the (hidden) name of the synthetic module. *) - acc - in - List.rev (List.fold_left (fun acc item -> wrapper_item item acc) [] items) - -let wrapper_module (dummy_id, _dummy_path) ~hidden items = - let items = wrapper_items dummy_id items in - let sig_ : Signature.t = { items; compiled = true; removed = []; doc = no_doc } in - let type_ : Module.decl = ModuleType (Signature sig_) in - let module_ : Module.t = {id=dummy_id; source_loc=None; doc=no_doc; type_; canonical=None; hidden} in - Signature.Module (Ordinary, module_) diff --git a/src/loader/cmi.mli b/src/loader/cmi.mli index df2f261341..a19f595fc1 100644 --- a/src/loader/cmi.mli +++ b/src/loader/cmi.mli @@ -128,16 +128,3 @@ val read_value_descr_modalities : val read_label_modalities : Types.label_declaration -> Odoc_model.Lang.Modalities.t - -val generate_wrapper_module : Paths.Identifier.Signature.t -> prefix:string -> hidden:bool -> Paths.Identifier.Module.t * Paths.Path.Module.t - -val wrapper_module : - Paths.Identifier.Module.t * Paths.Path.Module.t -> - hidden:bool -> - Odoc_model.Lang.Signature.item list -> - Odoc_model.Lang.Signature.item -(** [wrapper_module w ~hidden items] is the synthetic module an - [include functor] applies its functor to. Its items are aliases of - [items], the items that precede the include, so that whatever the functor's - expansion inherits from its argument resolves back to them rather than to - the (hidden) name of the wrapper. *) diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 158931f11f..f8b31f43cb 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -617,7 +617,7 @@ and read_include_functor env parent wrapper incl = | _ -> let mty = read_module_expr env parent container incl.incl_mod in let hidden = true in - let id, path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in + let id, path = Cmti.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in let m : Module.t = {id; source_loc=None; doc; type_=ModuleType mty; canonical=None; hidden} in ([Signature.Module (Ordinary, m)], path, ModuleType mty) in @@ -639,8 +639,8 @@ and read_items env parent items = #if defined OXCAML | Tstr_include ({ incl_kind = (Tincl_functor _ | Tincl_gen_functor _); _ } as incl) -> let hidden = true in - let wrapper = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in - let wrapper_module = Cmi.wrapper_module wrapper ~hidden (List.rev acc) in + let wrapper = Cmti.generate_wrapper_module parent ~prefix:"BODY" ~hidden in + let wrapper_module = Cmti.wrapper_module wrapper ~hidden (List.rev acc) in let items = read_include_functor env parent (snd wrapper) incl in List.rev_append items (wrapper_module :: acc) #endif diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index 8401765c20..c58e867204 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -38,6 +38,93 @@ let opt_map f = function | None -> None | Some x -> Some (f x) +let generate_wrapper_module = + let wrapper_counter = ref 0 in + fun parent ~prefix ~hidden -> + incr wrapper_counter; + let dummy_id = + let dummy_name = + let sep = match hidden with | true -> "__" | false -> "_" in + let name = Printf.sprintf "%s%s%d" prefix sep !wrapper_counter in + match hidden with + | false -> Odoc_model.Names.ModuleName.make_std name + | true -> Odoc_model.Names.ModuleName.hidden_of_string name + in + Identifier.Mk.module_ (parent, dummy_name) + in + let dummy_path = `Identifier (dummy_id, hidden) in + (dummy_id, dummy_path) + +let no_doc : Odoc_model.Comment.docs = { elements = []; warnings_tag = None } + +(* [include functor F] is modelled as the application of [F] to a synthetic, + hidden module holding the items that precede the include. + + That module's items are *aliases* of the real ones rather than copies: the + expansion of [F(BODY__n)] refers to the functor argument, so a copy would + leave the expansion mentioning [BODY__n.t], a hidden path, which the + generator renders as an abstract [type t]. With an alias, [BODY__n.t] + reduces to the enclosing signature's own [t] and is rendered, and linked, as + such. *) +let wrapper_items dummy_id items = + let module Id = Identifier in + let name id = Id.name id in + let parent = (dummy_id : Id.Module.t :> Id.Signature.t) in + (* Anonymous parameters ([_]) have to be named so that the alias can pass + them on to the item it aliases. *) + let alias_params params = + List.split + (List.mapi + (fun i (p : TypeDecl.param) -> + let v = match p.desc with Var v -> v | Any -> Printf.sprintf "a%d" i in + ({ p with TypeDecl.desc = TypeDecl.Var v }, TypeExpr.Var v)) + params) + in + let rec wrapper_item item acc = + match (item : Signature.item) with + | Type (rec_, td) -> + let params, args = alias_params td.equation.params in + let manifest = + Some (TypeExpr.Constr (`Identifier ((td.id :> Id.Path.Type.t), false), args)) + in + let equation = + { td.equation with TypeDecl.Equation.params; manifest; constraints = []; private_ = false } + in + let id = Id.Mk.type_ (parent, Odoc_model.Names.TypeName.make_std (name td.id)) in + Signature.Type (rec_, { td with TypeDecl.id; equation; representation = None; canonical = None; source_loc = None }) :: acc + | Module (rec_, m) -> + let id = Id.Mk.module_ (parent, Odoc_model.Names.ModuleName.make_std (name m.id)) in + let type_ = Module.Alias (`Identifier ((m.id :> Id.Path.Module.t), false), None) in + Signature.Module (rec_, { m with Module.id; type_; canonical = None; hidden = false; source_loc = None }) :: acc + | ModuleType mt -> + let id = Id.Mk.module_type (parent, Odoc_model.Names.ModuleTypeName.make_std (name mt.id)) in + let expr = + Some (ModuleType.Path { p_path = `Identifier ((mt.id :> Id.Path.ModuleType.t), false); p_expansion = None }) + in + Signature.ModuleType { mt with ModuleType.id; expr; canonical = None; source_loc = None } :: acc + | Include incl -> + (* The items an [include] brings in are visible to the functor too. *) + List.fold_left (fun acc item -> wrapper_item item acc) acc incl.Include.expansion.content.items + | Value _ | ModuleSubstitution _ | ModuleTypeSubstitution _ | Open _ + | TypeSubstitution _ | TypExt _ | Exception _ | Comment _ -> + (* Nothing in the expansion of [F(BODY__n)] can refer to these. *) + acc + | Class _ | ClassType _ -> + (* A class type of the argument can be referred to from the expansion, + but odoc does not chase class type aliases the way it chases type + manifests, so aliasing them here would not help: such a reference is + left printing the (hidden) name of the synthetic module. *) + acc + in + List.rev (List.fold_left (fun acc item -> wrapper_item item acc) [] items) + +let wrapper_module (dummy_id, _dummy_path) ~hidden items = + let items = wrapper_items dummy_id items in + let sig_ : Signature.t = { items; compiled = true; removed = []; doc = no_doc } in + let type_ : Module.decl = ModuleType (Signature sig_) in + let module_ : Module.t = {id=dummy_id; source_loc=None; doc=no_doc; type_; canonical=None; hidden} in + Signature.Module (Ordinary, module_) + let read_label = Cmi.read_label let rec read_core_type env container ctyp = @@ -930,7 +1017,7 @@ and read_include_functor env parent wrapper incl = let expr = read_module_type env include_parent include_container incl.incl_mod in let expansion = { content; shadowed; } in let hidden = true in - let id, functor_path = Cmi.generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in + let id, functor_path = generate_wrapper_module parent ~prefix:"INCLUDE" ~hidden in let functor_ : Module.t = {id; source_loc=None; doc; type_=ModuleType expr; canonical=None; hidden} in let decl = Functor {target = Path (`Apply (functor_path, wrapper)); original_ref = ModuleType expr} in [ Signature.Module (Ordinary, functor_); @@ -952,8 +1039,8 @@ and read_items env parent items = | Tsig_include ({ incl_kind = (Tincl_functor _ | Tincl_gen_functor _); incl_mod = { mty_desc = (Tmty_typeof _ | Tmty_ident _); _ }; _ } as incl, _) -> let hidden = true in - let wrapper = Cmi.generate_wrapper_module parent ~prefix:"BODY" ~hidden in - let wrapper_module = Cmi.wrapper_module wrapper ~hidden (List.rev acc) in + let wrapper = generate_wrapper_module parent ~prefix:"BODY" ~hidden in + let wrapper_module = wrapper_module wrapper ~hidden (List.rev acc) in let items = read_include_functor env parent (snd wrapper) incl in List.rev_append items (wrapper_module :: acc) #endif diff --git a/src/loader/cmti.mli b/src/loader/cmti.mli index d2e5905a2d..2268a367c5 100644 --- a/src/loader/cmti.mli +++ b/src/loader/cmti.mli @@ -67,3 +67,20 @@ val read_class_type_declarations : Paths.Identifier.Signature.t -> Typedtree.class_type Typedtree.class_infos list -> Odoc_model.Lang.Signature.item list + +val generate_wrapper_module : + Paths.Identifier.Signature.t -> + prefix:string -> + hidden:bool -> + Paths.Identifier.Module.t * Paths.Path.Module.t + +val wrapper_module : + Paths.Identifier.Module.t * Paths.Path.Module.t -> + hidden:bool -> + Odoc_model.Lang.Signature.item list -> + Odoc_model.Lang.Signature.item +(** [wrapper_module w ~hidden items] is the synthetic module an + [include functor] applies its functor to. Its items are aliases of [items], + the items that precede the include, so that whatever the functor's expansion + inherits from its argument resolves back to them rather than to the (hidden) + name of the wrapper. *) From 68435924bc3be9da535eadc01383025e08307184 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Thu, 3 Sep 2026 16:57:45 +0200 Subject: [PATCH 23/23] Add class and class type and alias input module --- test/generators/cases/oxcaml.mli | 22 ++ ...ment_shapes-Aliased-To_include_module.html | 38 +++ ...ed-module-type-To_include_module_type.html | 40 +++ ...clude_functor_argument_shapes-Aliased.html | 155 +++++++++ ...shapes-Make-argument-1-T-class-class_.html | 36 +++ ...es-Make-argument-1-T-class-class_type.html | 37 +++ ...tor_argument_shapes-Make-argument-1-T.html | 35 ++ ...apes-Make-class-output_class_via_name.html | 37 +++ ...apes-Make-class-output_class_via_type.html | 37 +++ ...-Include_functor_argument_shapes-Make.html | 62 ++++ ..._functor_argument_shapes-class-class_.html | 32 ++ ...ctor_argument_shapes-class-class_type.html | 34 ++ ...nt_shapes-class-output_class_via_name.html | 37 +++ ...nt_shapes-class-output_class_via_type.html | 37 +++ ...t_shapes-module-type-Arg-class-class_.html | 34 ++ ...apes-module-type-Arg-class-class_type.html | 34 ++ ...nctor_argument_shapes-module-type-Arg.html | 35 ++ ...xcaml-Include_functor_argument_shapes.html | 87 +++++ test/generators/html/oxcaml.targets | 13 + test/generators/latex/Oxcaml.tex | 10 + test/generators/link.dune.inc | 306 ++++++++++++++++++ .../Oxcaml.Include_functor_argument_shapes.3o | 43 +++ ...Include_functor_argument_shapes.Aliased.3o | 43 +++ ...gument_shapes.Aliased.To_include_module.3o | 14 + ...ml.Include_functor_argument_shapes.Make.3o | 39 +++ ...shapes.Make.class-output_class_via_name.3o | 17 + ...shapes.Make.class-output_class_via_type.3o | 17 + ...de_functor_argument_shapes.class-class_.3o | 14 + ...unctor_argument_shapes.class-class_type.3o | 14 + ...ment_shapes.class-output_class_via_name.3o | 17 + ...ment_shapes.class-output_class_via_type.3o | 17 + test/generators/man/oxcaml.targets | 8 + ...gument_shapes-Aliased-To_include_module.md | 6 + ...ased-module-type-To_include_module_type.md | 6 + ...Include_functor_argument_shapes-Aliased.md | 34 ++ ...t_shapes-Make-argument-1-T-class-class_.md | 6 + ...apes-Make-argument-1-T-class-class_type.md | 6 + ...nctor_argument_shapes-Make-argument-1-T.md | 6 + ...shapes-Make-class-output_class_via_name.md | 8 + ...shapes-Make-class-output_class_via_type.md | 8 + ...ml-Include_functor_argument_shapes-Make.md | 15 + ...de_functor_argument_shapes-class-class_.md | 6 + ...unctor_argument_shapes-class-class_type.md | 6 + ...ment_shapes-class-output_class_via_name.md | 8 + ...ment_shapes-class-output_class_via_type.md | 8 + ...ent_shapes-module-type-Arg-class-class_.md | 6 + ...shapes-module-type-Arg-class-class_type.md | 6 + ...functor_argument_shapes-module-type-Arg.md | 6 + .../Oxcaml-Include_functor_argument_shapes.md | 21 ++ test/generators/markdown/oxcaml.targets | 13 + 50 files changed, 1576 insertions(+) create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_type.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html create mode 100644 test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_type.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o create mode 100644 test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_type.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md create mode 100644 test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md diff --git a/test/generators/cases/oxcaml.mli b/test/generators/cases/oxcaml.mli index c81169aa1f..0f6678709c 100644 --- a/test/generators/cases/oxcaml.mli +++ b/test/generators/cases/oxcaml.mli @@ -551,6 +551,12 @@ module Include_functor_argument_shapes : sig module type S val via_module_type_include : unit val via_module_include : unit + + class class_type : object + val content : int + end + + class class_ : class_type end module Make (T : Arg) : sig @@ -572,6 +578,16 @@ module Include_functor_argument_shapes : sig module type Reexported = T.S (** A module type of the argument, aliased as a path to it. *) + + class output_class_via_type : T.class_type + (** A class whose type comes from an explicitely named class type *) + + class output_class_via_name : T.class_ + (** A class whose type comes from the name of a class *) + + module Aliased = T + (** The input module itself. It should contain everything from the top + level module *) end (**/**) @@ -584,6 +600,12 @@ module Include_functor_argument_shapes : sig end (**/**) + class class_type : object + val content : int + end + + class class_ : class_type + type t type 'a p type _ anon diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html new file mode 100644 index 0000000000..77fba13f18 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html @@ -0,0 +1,38 @@ + + + + + To_include_module + (Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module) + + + + + + + + +
    +

    Module Aliased.To_include_module

    +
    +
    +
    +
    + + + val via_module_include : unit + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html new file mode 100644 index 0000000000..3bb9b9930f --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html @@ -0,0 +1,40 @@ + + + + + To_include_module_type + (Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module_type) + + + + + + + + +
    +

    Module type Aliased.To_include_module_type +

    +
    +
    +
    +
    + + + val via_module_type_include : unit + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased.html new file mode 100644 index 0000000000..cdb41b1535 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Aliased.html @@ -0,0 +1,155 @@ + + + + Aliased (Oxcaml.Include_functor_argument_shapes.Aliased) + + + + + + + + +
    +

    Module + Include_functor_argument_shapes.Aliased +

    +

    The input module itself. It should contain everything from the + top level module +

    +
    +
    +
    +
    + + + module + type Arg + + = + + Arg + + + +
    +
    +

    Everything the expansion of the functor can inherit from its + argument: types, including parameterised and anonymously parameterised + ones, submodules, and module types. +

    +
    +
    +
    +
    + + module Make + = + Make + + +
    +
    +
    +
    + + + module + type + To_include_module_type + + + = sig ... + end + + +
    +
    +
    +
    + + + module + To_include_module + + + : sig ... + end + + +
    +
    +
    +
    + + type t + = + t + + +
    +
    +
    +
    + + type 'a p + = + 'a + p + + + +
    +
    +
    +
    + + + type 'a0 anon + = + 'a0 + anon + + + + +
    +
    +
    +
    + + module X + = X + + +
    +
    +
    +
    + + + module + type S + + = + S + + + +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html new file mode 100644 index 0000000000..ad1d96abc2 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html @@ -0,0 +1,36 @@ + + + + class_ (Oxcaml.Include_functor_argument_shapes.Make.T.class_) + + + + + + + + +
    +

    Class T.class_

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html new file mode 100644 index 0000000000..7290e46fb3 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html @@ -0,0 +1,37 @@ + + + + + class_type (Oxcaml.Include_functor_argument_shapes.Make.T.class_type) + + + + + + + + +
    +

    Class T.class_type

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html index b5b1b82051..cd538076ed 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html @@ -85,6 +85,41 @@

    Parameter Make.T

    +
    +
    + + class + + class_type + + + : object ... + end + + +
    +
    +
    +
    + + class + + class_ + + + : + class_type + + + +
    +
    diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html new file mode 100644 index 0000000000..6be92b13b7 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html @@ -0,0 +1,37 @@ + + + + + output_class_via_name + (Oxcaml.Include_functor_argument_shapes.Make.output_class_via_name) + + + + + + + + +
    +

    Class Make.output_class_via_name

    +

    A class whose type comes from the name of a class

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html new file mode 100644 index 0000000000..d51dc370c8 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html @@ -0,0 +1,37 @@ + + + + + output_class_via_type + (Oxcaml.Include_functor_argument_shapes.Make.output_class_via_type) + + + + + + + + +
    +

    Class Make.output_class_via_type

    +

    A class whose type comes from an explicitely named class type

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html index dbadd7b1d3..eee39bd35c 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-Make.html @@ -145,6 +145,68 @@

    Signature

    A module type of the argument, aliased as a path to it.

    +
    +
    + + class + + output_class_via_type + + + : + T.class_type + + + +
    +
    +

    A class whose type comes from an explicitely named class type

    +
    +
    +
    +
    + + class + + output_class_via_name + + + : + T.class_ + + + +
    +
    +

    A class whose type comes from the name of a class

    +
    +
    +
    +
    + + module Aliased + = + + T + + + +
    +
    +

    The input module itself. It should contain everything from the + top level module +

    +
    +
    diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_.html new file mode 100644 index 0000000000..ceaeef0a11 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_.html @@ -0,0 +1,32 @@ + + + class_ (Oxcaml.Include_functor_argument_shapes.class_) + + + + + + + + +
    +

    Class Include_functor_argument_shapes.class_ +

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_type.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_type.html new file mode 100644 index 0000000000..a2d3ce88ee --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-class_type.html @@ -0,0 +1,34 @@ + + + + class_type (Oxcaml.Include_functor_argument_shapes.class_type) + + + + + + + + +
    +

    Class + Include_functor_argument_shapes.class_type +

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html new file mode 100644 index 0000000000..e809b39110 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html @@ -0,0 +1,37 @@ + + + + + output_class_via_name + (Oxcaml.Include_functor_argument_shapes.output_class_via_name) + + + + + + + + +
    +

    Class + Include_functor_argument_shapes.output_class_via_name + +

    A class whose type comes from the name of a class

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html new file mode 100644 index 0000000000..57fe346139 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html @@ -0,0 +1,37 @@ + + + + + output_class_via_type + (Oxcaml.Include_functor_argument_shapes.output_class_via_type) + + + + + + + + +
    +

    Class + Include_functor_argument_shapes.output_class_via_type + +

    A class whose type comes from an explicitely named class type

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html new file mode 100644 index 0000000000..a28e56fbef --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html @@ -0,0 +1,34 @@ + + + + class_ (Oxcaml.Include_functor_argument_shapes.Arg.class_) + + + + + + + + +
    +

    Class Arg.class_

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html new file mode 100644 index 0000000000..32cd1096e0 --- /dev/null +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html @@ -0,0 +1,34 @@ + + + + class_type (Oxcaml.Include_functor_argument_shapes.Arg.class_type) + + + + + + + + +
    +

    Class Arg.class_type

    +
    +
    +
    +
    + + val content : int +
    +
    +
    + + diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html index 9627fbc9bf..838567de9a 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes-module-type-Arg.html @@ -89,6 +89,41 @@

    Module type +
    +
    + + class + + class_type + + + : object ... + end + + +
    +
    +
    +
    + + class + + class_ + + + : + class_type + + + +
    +
    diff --git a/test/generators/html/Oxcaml-Include_functor_argument_shapes.html b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html index 14752db5d7..f274508ce8 100644 --- a/test/generators/html/Oxcaml-Include_functor_argument_shapes.html +++ b/test/generators/html/Oxcaml-Include_functor_argument_shapes.html @@ -62,6 +62,38 @@

    Module +
    +
    + + class + + + class_type + + + : object ... + end + + +
    +
    +
    +
    + + class + + + class_ + + + : + + class_type + + + +
    +
    @@ -212,6 +244,61 @@

    Module

    A module type of the argument, aliased as a path to it.

    +
    +
    + + class + + output_class_via_type + + + : BODY__3.class_type + + +
    +
    +

    A class whose type comes from an explicitely named class type

    +
    +
    +
    +
    + + class + + output_class_via_name + + + : BODY__3.class_ + +
    +
    +

    A class whose type comes from the name of a class

    +
    +
    +
    +
    + + + module + + Aliased + + + : sig ... + end + + +
    +
    +

    The input module itself. It should contain everything from + the top level module +

    +
    +
    diff --git a/test/generators/html/oxcaml.targets b/test/generators/html/oxcaml.targets index 97efa52fb5..ace7794ba2 100644 --- a/test/generators/html/oxcaml.targets +++ b/test/generators/html/oxcaml.targets @@ -18,11 +18,24 @@ Oxcaml-Include_functor-Make-argument-1-T.html Oxcaml-Include_functor_argument_shapes.html Oxcaml-Include_functor_argument_shapes-module-type-Arg.html Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html +Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html +Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html Oxcaml-Include_functor_argument_shapes-Make.html Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html +Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html +Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html +Oxcaml-Include_functor_argument_shapes-class-class_type.html +Oxcaml-Include_functor_argument_shapes-class-class_.html Oxcaml-Include_functor_argument_shapes-X.html Oxcaml-Include_functor_argument_shapes-module-type-S.html +Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html +Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html +Oxcaml-Include_functor_argument_shapes-Aliased.html +Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html +Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html Oxcaml-Include_functor_desugared.html Oxcaml-Include_functor_desugared-Make.html Oxcaml-Include_functor_desugared-Make-argument-1-T.html diff --git a/test/generators/latex/Oxcaml.tex b/test/generators/latex/Oxcaml.tex index 0078f37efc..9055b076e9 100644 --- a/test/generators/latex/Oxcaml.tex +++ b/test/generators/latex/Oxcaml.tex @@ -419,10 +419,14 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--module-type-S}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} S}\\ \label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--val-via_module_type_include}\ocamlcodefragment{\ocamltag{keyword}{val} via\_\allowbreak{}module\_\allowbreak{}type\_\allowbreak{}include : unit}\\ \label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--val-via_module_include}\ocamlcodefragment{\ocamltag{keyword}{val} via\_\allowbreak{}module\_\allowbreak{}include : unit}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--class-class_type}\ocamlcodefragment{\ocamltag{keyword}{class} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type]{\ocamlinlinecode{class\_\allowbreak{}type}}}\ocamlcodefragment{ : \ocamltag{keyword}{object} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ +\label{Oxcaml-Include_functor_argument_shapes-module-type-Arg--class-class_}\ocamlcodefragment{\ocamltag{keyword}{class} \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_]{\ocamlinlinecode{class\_\allowbreak{}}}}\ocamlcodefragment{ : \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type]{\ocamlinlinecode{class\_\allowbreak{}type}}}\\ \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types.\end{ocamlindent}% \medbreak \label{Oxcaml-Include_functor_argument_shapes--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_argument_shapes-Make-argument-1-T]{\ocamlinlinecode{T}} : \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-Arg]{\ocamlinlinecode{Arg}}) : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ +\label{Oxcaml-Include_functor_argument_shapes--class-class_type}\ocamlcodefragment{\ocamltag{keyword}{class} \hyperref[Oxcaml-Include_functor_argument_shapes-class-class_type]{\ocamlinlinecode{class\_\allowbreak{}type}}}\ocamlcodefragment{ : \ocamltag{keyword}{object} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\\ +\label{Oxcaml-Include_functor_argument_shapes--class-class_}\ocamlcodefragment{\ocamltag{keyword}{class} \hyperref[Oxcaml-Include_functor_argument_shapes-class-class_]{\ocamlinlinecode{class\_\allowbreak{}}}}\ocamlcodefragment{ : \hyperref[Oxcaml-Include_functor_argument_shapes-class-class_type]{\ocamlinlinecode{class\_\allowbreak{}type}}}\\ \label{Oxcaml-Include_functor_argument_shapes--type-t}\ocamlcodefragment{\ocamltag{keyword}{type} t}\\ \label{Oxcaml-Include_functor_argument_shapes--type-p}\ocamlcodefragment{\ocamltag{keyword}{type} 'a p}\\ \label{Oxcaml-Include_functor_argument_shapes--type-anon}\ocamlcodefragment{\ocamltag{keyword}{type} \_\allowbreak{} anon}\\ @@ -444,6 +448,12 @@ \subsection{Include functor on signatures\label{Oxcaml--include-functor-on-signa \medbreak \label{Oxcaml-Include_functor_argument_shapes--module-type-Reexported}\ocamlcodefragment{\ocamltag{keyword}{module} \ocamltag{keyword}{type} Reexported = \hyperref[Oxcaml-Include_functor_argument_shapes-module-type-S]{\ocamlinlinecode{S}}}\begin{ocamlindent}A module type of the argument, aliased as a path to it.\end{ocamlindent}% \medbreak +\label{Oxcaml-Include_functor_argument_shapes--class-output_class_via_type}\ocamlcodefragment{\ocamltag{keyword}{class} \hyperref[Oxcaml-Include_functor_argument_shapes-class-output_class_via_type]{\ocamlinlinecode{output\_\allowbreak{}class\_\allowbreak{}via\_\allowbreak{}type}}}\ocamlcodefragment{ : \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}3.\allowbreak{}class\_\allowbreak{}type}}}\begin{ocamlindent}A class whose type comes from an explicitely named class type\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_argument_shapes--class-output_class_via_name}\ocamlcodefragment{\ocamltag{keyword}{class} \hyperref[Oxcaml-Include_functor_argument_shapes-class-output_class_via_name]{\ocamlinlinecode{output\_\allowbreak{}class\_\allowbreak{}via\_\allowbreak{}name}}}\ocamlcodefragment{ : \hyperref[xref-unresolved]{\ocamlinlinecode{BODY\_\allowbreak{}\_\allowbreak{}3.\allowbreak{}class\_\allowbreak{}}}}\begin{ocamlindent}A class whose type comes from the name of a class\end{ocamlindent}% +\medbreak +\label{Oxcaml-Include_functor_argument_shapes--module-Aliased}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_argument_shapes-Aliased]{\ocamlinlinecode{Aliased}}}\ocamlcodefragment{ : \ocamltag{keyword}{sig} .\allowbreak{}.\allowbreak{}.\allowbreak{} \ocamltag{keyword}{end}}\begin{ocamlindent}The input module itself. It should contain everything from the top level module\end{ocamlindent}% +\medbreak \end{ocamlindent}% \ocamlcodefragment{\ocamltag{keyword}{end}}\\ \label{Oxcaml--module-Include_functor_desugared}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared]{\ocamlinlinecode{Include\_\allowbreak{}functor\_\allowbreak{}desugared}}}\label{Oxcaml-Include_functor_desugared}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\label{Oxcaml-Include_functor_desugared--module-Make}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Oxcaml-Include_functor_desugared-Make]{\ocamlinlinecode{Make}}}\ocamlcodefragment{ (\hyperref[Oxcaml-Include_functor_desugared-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 is the desugared version of \hyperref[Oxcaml-Include_functor]{\ocamlinlinecode{\ocamlinlinecode{Include\_\allowbreak{}functor}}[p\pageref*{Oxcaml-Include_functor}]}: the synthetic module aliases the preceding items rather than copying them, so that the types the functor inherits from its argument resolve back to them.\end{ocamlindent}% diff --git a/test/generators/link.dune.inc b/test/generators/link.dune.inc index 16d390567a..f1f4b3dee7 100644 --- a/test/generators/link.dune.inc +++ b/test/generators/link.dune.inc @@ -11967,11 +11967,24 @@ Oxcaml-Include_functor_argument_shapes.html.gen Oxcaml-Include_functor_argument_shapes-module-type-Arg.html.gen Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html.gen Oxcaml-Include_functor_argument_shapes-Make.html.gen Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.html.gen Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html.gen + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html.gen + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html.gen + Oxcaml-Include_functor_argument_shapes-class-class_type.html.gen + Oxcaml-Include_functor_argument_shapes-class-class_.html.gen Oxcaml-Include_functor_argument_shapes-X.html.gen Oxcaml-Include_functor_argument_shapes-module-type-S.html.gen + Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html.gen + Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html.gen + Oxcaml-Include_functor_argument_shapes-Aliased.html.gen + Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html.gen + Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html.gen Oxcaml-Include_functor_desugared.html.gen Oxcaml-Include_functor_desugared-Make.html.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.html.gen @@ -12145,6 +12158,22 @@ Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.html.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.html.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12169,6 +12198,54 @@ Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.html.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-class_type.html + Oxcaml-Include_functor_argument_shapes-class-class_type.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-class_.html + Oxcaml-Include_functor_argument_shapes-class-class_.html.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12185,6 +12262,46 @@ Oxcaml-Include_functor_argument_shapes-module-type-S.html Oxcaml-Include_functor_argument_shapes-module-type-S.html.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html + Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html + Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Aliased.html + Oxcaml-Include_functor_argument_shapes-Aliased.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html + Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.html.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html + Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.html.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12449,7 +12566,15 @@ Oxcaml.Include_functor.Make.3o.gen Oxcaml.Include_functor_argument_shapes.3o.gen Oxcaml.Include_functor_argument_shapes.Make.3o.gen + Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o.gen + Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o.gen + Oxcaml.Include_functor_argument_shapes.class-class_type.3o.gen + Oxcaml.Include_functor_argument_shapes.class-class_.3o.gen Oxcaml.Include_functor_argument_shapes.X.3o.gen + Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o.gen + Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o.gen + Oxcaml.Include_functor_argument_shapes.Aliased.3o.gen + Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o.gen Oxcaml.Include_functor_desugared.3o.gen Oxcaml.Include_functor_desugared.Make.3o.gen Oxcaml.Include_functor_named_type_desugared.3o.gen @@ -12556,6 +12681,38 @@ Oxcaml.Include_functor_argument_shapes.Make.3o Oxcaml.Include_functor_argument_shapes.Make.3o.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o + Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o + Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.class-class_type.3o + Oxcaml.Include_functor_argument_shapes.class-class_type.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.class-class_.3o + Oxcaml.Include_functor_argument_shapes.class-class_.3o.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12564,6 +12721,38 @@ Oxcaml.Include_functor_argument_shapes.X.3o Oxcaml.Include_functor_argument_shapes.X.3o.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o + Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o + Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.Aliased.3o + Oxcaml.Include_functor_argument_shapes.Aliased.3o.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o + Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12700,11 +12889,24 @@ Oxcaml-Include_functor_argument_shapes.md.gen Oxcaml-Include_functor_argument_shapes-module-type-Arg.md.gen Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md.gen + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md.gen Oxcaml-Include_functor_argument_shapes-Make.md.gen Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md.gen Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md.gen + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md.gen + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md.gen + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md.gen + Oxcaml-Include_functor_argument_shapes-class-class_type.md.gen + Oxcaml-Include_functor_argument_shapes-class-class_.md.gen Oxcaml-Include_functor_argument_shapes-X.md.gen Oxcaml-Include_functor_argument_shapes-module-type-S.md.gen + Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md.gen + Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md.gen + Oxcaml-Include_functor_argument_shapes-Aliased.md.gen + Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md.gen + Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md.gen Oxcaml-Include_functor_desugared.md.gen Oxcaml-Include_functor_desugared-Make.md.gen Oxcaml-Include_functor_desugared-Make-argument-1-T.md.gen @@ -12870,6 +13072,22 @@ Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md + Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12894,6 +13112,54 @@ Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md + Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md + Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-class_type.md + Oxcaml-Include_functor_argument_shapes-class-class_type.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-class_.md + Oxcaml-Include_functor_argument_shapes-class-class_.md.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) @@ -12910,6 +13176,46 @@ Oxcaml-Include_functor_argument_shapes-module-type-S.md Oxcaml-Include_functor_argument_shapes-module-type-S.md.gen)) (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md + Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md + Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Aliased.md + Oxcaml-Include_functor_argument_shapes-Aliased.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md + Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md.gen)) + (enabled_if %{ocaml-config:ox})) + (rule + (alias runtest) + (package odoc) + (action + (diff + Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md + Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md.gen)) + (enabled_if %{ocaml-config:ox})) (rule (alias runtest) (package odoc) diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o index e09f991b1a..1362956c40 100644 --- a/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.3o @@ -39,6 +39,24 @@ Oxcaml\.Include_functor_argument_shapes .sp .ti +2 \f[CB]val\fR via_module_include : unit +.sp +.ti +2 +\f[CB]class\fR class_type : \f[CB]object\fR +.br +.ti +4 +\f[CB]val\fR content : int +.br +.ti +2 +\f[CB]end\fR +.sp +.ti +2 +\f[CB]class\fR class_ : \f[CB]object\fR +.br +.ti +4 +\f[CB]val\fR content : int +.br +.ti +2 +\f[CB]end\fR .br \f[CB]end\fR .fi @@ -49,6 +67,10 @@ Everything the expansion of the functor can inherit from its argument: types, in .sp \f[CB]module\fR Make (T : Arg) : \f[CB]sig\fR \.\.\. \f[CB]end\fR .sp +\f[CB]class\fR class_type : \f[CB]object\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]class\fR class_ : class_type +.sp \f[CB]type\fR t .sp \f[CB]type\fR 'a p @@ -102,4 +124,25 @@ Reached through a submodule of the argument, aliased as module X = X\. .ti +2 A module type of the argument, aliased as a path to it\. .nf +.sp +\f[CB]class\fR output_class_via_type : BODY__3\.class_type +.fi +.br +.ti +2 +A class whose type comes from an explicitely named class type +.nf +.sp +\f[CB]class\fR output_class_via_name : BODY__3\.class_ +.fi +.br +.ti +2 +A class whose type comes from the name of a class +.nf +.sp +\f[CB]module\fR Aliased : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.fi +.br +.ti +2 +The input module itself\. It should contain everything from the top level module +.nf diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.3o new file mode 100644 index 0000000000..774261761c --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.3o @@ -0,0 +1,43 @@ + +.TH Aliased 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.Aliased +.SH Synopsis +.sp +.in 2 +\fBModule Include_functor_argument_shapes\.Aliased\fR +.in +.sp +.fi +The input module itself\. It should contain everything from the top level module +.nf +.SH Documentation +.sp +.nf +\f[CB]module\fR \f[CB]type\fR Arg = Arg +.fi +.br +.ti +2 +Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types\. +.nf +.sp +\f[CB]module\fR Make = Make +.sp +\f[CB]module\fR \f[CB]type\fR To_include_module_type = \f[CB]sig\fR +.br +.ti +2 +\f[CB]val\fR via_module_type_include : unit +.br +\f[CB]end\fR +.sp +\f[CB]module\fR To_include_module : \f[CB]sig\fR \.\.\. \f[CB]end\fR +.sp +\f[CB]type\fR t = t +.sp +\f[CB]type\fR 'a p = \f[CB]'a\fR p +.sp +\f[CB]type\fR 'a0 anon = \f[CB]'a0\fR anon +.sp +\f[CB]module\fR X = X +.sp +\f[CB]module\fR \f[CB]type\fR S = S diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o new file mode 100644 index 0000000000..a6784e9c00 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o @@ -0,0 +1,14 @@ + +.TH To_include_module 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.Aliased\.To_include_module +.SH Synopsis +.sp +.in 2 +\fBModule Aliased\.To_include_module\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]val\fR via_module_include : unit diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o index b998fa6a49..9829258d88 100644 --- a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.3o @@ -44,6 +44,24 @@ Oxcaml\.Include_functor_argument_shapes\.Make .sp .ti +2 \f[CB]val\fR via_module_include : unit +.sp +.ti +2 +\f[CB]class\fR class_type : \f[CB]object\fR +.br +.ti +4 +\f[CB]val\fR content : int +.br +.ti +2 +\f[CB]end\fR +.sp +.ti +2 +\f[CB]class\fR class_ : \f[CB]object\fR +.br +.ti +4 +\f[CB]val\fR content : int +.br +.ti +2 +\f[CB]end\fR .br \f[CB]end\fR .sp @@ -85,4 +103,25 @@ Reached through a submodule of the argument, aliased as module X = X\. .ti +2 A module type of the argument, aliased as a path to it\. .nf +.sp +\f[CB]class\fR output_class_via_type : T\.class_type +.fi +.br +.ti +2 +A class whose type comes from an explicitely named class type +.nf +.sp +\f[CB]class\fR output_class_via_name : T\.class_ +.fi +.br +.ti +2 +A class whose type comes from the name of a class +.nf +.sp +\f[CB]module\fR Aliased = T +.fi +.br +.ti +2 +The input module itself\. It should contain everything from the top level module +.nf diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o new file mode 100644 index 0000000000..01d38a951e --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o @@ -0,0 +1,17 @@ + +.TH output_class_via_name 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.Make\.output_class_via_name +.SH Synopsis +.sp +.in 2 +\fBClass Make\.output_class_via_name\fR +.in +.sp +.fi +A class whose type comes from the name of a class +.nf +.SH Documentation +.sp +.nf +\f[CB]val\fR content : int diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o new file mode 100644 index 0000000000..b081ee0f74 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o @@ -0,0 +1,17 @@ + +.TH output_class_via_type 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.Make\.output_class_via_type +.SH Synopsis +.sp +.in 2 +\fBClass Make\.output_class_via_type\fR +.in +.sp +.fi +A class whose type comes from an explicitely named class type +.nf +.SH Documentation +.sp +.nf +\f[CB]val\fR content : int diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_.3o new file mode 100644 index 0000000000..0734bca6b9 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_.3o @@ -0,0 +1,14 @@ + +.TH class_ 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.class_ +.SH Synopsis +.sp +.in 2 +\fBClass Include_functor_argument_shapes\.class_\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]val\fR content : int diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_type.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_type.3o new file mode 100644 index 0000000000..cf20f7edd1 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-class_type.3o @@ -0,0 +1,14 @@ + +.TH class_type 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.class_type +.SH Synopsis +.sp +.in 2 +\fBClass Include_functor_argument_shapes\.class_type\fR +.in +.sp +.SH Documentation +.sp +.nf +\f[CB]val\fR content : int diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o new file mode 100644 index 0000000000..1f951ae769 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o @@ -0,0 +1,17 @@ + +.TH output_class_via_name 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.output_class_via_name +.SH Synopsis +.sp +.in 2 +\fBClass Include_functor_argument_shapes\.output_class_via_name\fR +.in +.sp +.fi +A class whose type comes from the name of a class +.nf +.SH Documentation +.sp +.nf +\f[CB]val\fR content : int diff --git a/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o new file mode 100644 index 0000000000..f71b92fd36 --- /dev/null +++ b/test/generators/man/Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o @@ -0,0 +1,17 @@ + +.TH output_class_via_type 3 "" "Odoc" "OCaml Library" +.SH Name +Oxcaml\.Include_functor_argument_shapes\.output_class_via_type +.SH Synopsis +.sp +.in 2 +\fBClass Include_functor_argument_shapes\.output_class_via_type\fR +.in +.sp +.fi +A class whose type comes from an explicitely named class type +.nf +.SH Documentation +.sp +.nf +\f[CB]val\fR content : int diff --git a/test/generators/man/oxcaml.targets b/test/generators/man/oxcaml.targets index 0b3ba64404..10d7413bbe 100644 --- a/test/generators/man/oxcaml.targets +++ b/test/generators/man/oxcaml.targets @@ -12,7 +12,15 @@ Oxcaml.Include_functor.3o Oxcaml.Include_functor.Make.3o Oxcaml.Include_functor_argument_shapes.3o Oxcaml.Include_functor_argument_shapes.Make.3o +Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_type.3o +Oxcaml.Include_functor_argument_shapes.Make.class-output_class_via_name.3o +Oxcaml.Include_functor_argument_shapes.class-class_type.3o +Oxcaml.Include_functor_argument_shapes.class-class_.3o Oxcaml.Include_functor_argument_shapes.X.3o +Oxcaml.Include_functor_argument_shapes.class-output_class_via_type.3o +Oxcaml.Include_functor_argument_shapes.class-output_class_via_name.3o +Oxcaml.Include_functor_argument_shapes.Aliased.3o +Oxcaml.Include_functor_argument_shapes.Aliased.To_include_module.3o Oxcaml.Include_functor_desugared.3o Oxcaml.Include_functor_desugared.Make.3o Oxcaml.Include_functor_named_type_desugared.3o diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md new file mode 100644 index 0000000000..9c49e351bc --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md @@ -0,0 +1,6 @@ + +# Module `Aliased.To_include_module` + +```ocaml +val via_module_include : unit +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md new file mode 100644 index 0000000000..8dce7feb6d --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md @@ -0,0 +1,6 @@ + +# Module type `Aliased.To_include_module_type` + +```ocaml +val via_module_type_include : unit +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased.md new file mode 100644 index 0000000000..ac30a607d4 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Aliased.md @@ -0,0 +1,34 @@ + +# Module `Include_functor_argument_shapes.Aliased` + +The input module itself. It should contain everything from the top level module + +```ocaml +module type Arg = Arg +``` +Everything the expansion of the functor can inherit from its argument: types, including parameterised and anonymously parameterised ones, submodules, and module types. + +```ocaml +module Make = Make +``` +```ocaml +module type To_include_module_type = sig ... end +``` +```ocaml +module To_include_module : sig ... end +``` +```ocaml +type t = t +``` +```ocaml +type 'a p = 'a p +``` +```ocaml +type 'a0 anon = 'a0 anon +``` +```ocaml +module X = X +``` +```ocaml +module type S = S +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md new file mode 100644 index 0000000000..fd0d42b5ec --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md @@ -0,0 +1,6 @@ + +# Class `T.class_` + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md new file mode 100644 index 0000000000..6bd1a23caa --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md @@ -0,0 +1,6 @@ + +# Class `T.class_type` + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md index 638ea1c122..cb930fd5df 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md @@ -21,4 +21,10 @@ val via_module_type_include : unit ``` ```ocaml val via_module_include : unit +``` +```ocaml +class class_type : object ... end +``` +```ocaml +class class_ : class_type ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md new file mode 100644 index 0000000000..933bf4b11f --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md @@ -0,0 +1,8 @@ + +# Class `Make.output_class_via_name` + +A class whose type comes from the name of a class + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md new file mode 100644 index 0000000000..90680e3227 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md @@ -0,0 +1,8 @@ + +# Class `Make.output_class_via_type` + +A class whose type comes from an explicitely named class type + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md index b2c056b688..ab29582572 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-Make.md @@ -34,3 +34,18 @@ Reached through a submodule of the argument, aliased as `module X = X`. module type Reexported = T.S ``` A module type of the argument, aliased as a path to it. + +```ocaml +class output_class_via_type : T.class_type +``` +A class whose type comes from an explicitely named class type + +```ocaml +class output_class_via_name : T.class_ +``` +A class whose type comes from the name of a class + +```ocaml +module Aliased = T +``` +The input module itself. It should contain everything from the top level module diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_.md new file mode 100644 index 0000000000..efde79eb0b --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_.md @@ -0,0 +1,6 @@ + +# Class `Include_functor_argument_shapes.class_` + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_type.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_type.md new file mode 100644 index 0000000000..63bf6f2386 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-class_type.md @@ -0,0 +1,6 @@ + +# Class `Include_functor_argument_shapes.class_type` + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md new file mode 100644 index 0000000000..d253781345 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md @@ -0,0 +1,8 @@ + +# Class `Include_functor_argument_shapes.output_class_via_name` + +A class whose type comes from the name of a class + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md new file mode 100644 index 0000000000..a5765dc1b1 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md @@ -0,0 +1,8 @@ + +# Class `Include_functor_argument_shapes.output_class_via_type` + +A class whose type comes from an explicitely named class type + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md new file mode 100644 index 0000000000..968575c9b9 --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md @@ -0,0 +1,6 @@ + +# Class `Arg.class_` + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md new file mode 100644 index 0000000000..79de1f6bba --- /dev/null +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md @@ -0,0 +1,6 @@ + +# Class `Arg.class_type` + +```ocaml +val content : int +``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md index aab9997090..0da98aa193 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes-module-type-Arg.md @@ -23,4 +23,10 @@ val via_module_type_include : unit ``` ```ocaml val via_module_include : unit +``` +```ocaml +class class_type : object ... end +``` +```ocaml +class class_ : class_type ``` \ No newline at end of file diff --git a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md index c09c55ea6c..3d478f075b 100644 --- a/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md +++ b/test/generators/markdown/Oxcaml-Include_functor_argument_shapes.md @@ -10,6 +10,12 @@ Everything the expansion of the functor can inherit from its argument: types, in module Make (T : Arg) : sig ... end ``` ```ocaml +class class_type : object ... end +``` +```ocaml +class class_ : class_type +``` +```ocaml type t ``` ```ocaml @@ -54,3 +60,18 @@ Reached through a submodule of the argument, aliased as `module X = X`. module type Reexported = S ``` A module type of the argument, aliased as a path to it. + +```ocaml +class output_class_via_type : BODY__3.class_type +``` +A class whose type comes from an explicitely named class type + +```ocaml +class output_class_via_name : BODY__3.class_ +``` +A class whose type comes from the name of a class + +```ocaml +module Aliased : sig ... end +``` +The input module itself. It should contain everything from the top level module diff --git a/test/generators/markdown/oxcaml.targets b/test/generators/markdown/oxcaml.targets index ca56a378aa..522ed593dd 100644 --- a/test/generators/markdown/oxcaml.targets +++ b/test/generators/markdown/oxcaml.targets @@ -18,11 +18,24 @@ Oxcaml-Include_functor-Make-argument-1-T.md Oxcaml-Include_functor_argument_shapes.md Oxcaml-Include_functor_argument_shapes-module-type-Arg.md Oxcaml-Include_functor_argument_shapes-module-type-Arg-X.md +Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_type.md +Oxcaml-Include_functor_argument_shapes-module-type-Arg-class-class_.md Oxcaml-Include_functor_argument_shapes-Make.md Oxcaml-Include_functor_argument_shapes-Make-argument-1-T.md Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-X.md +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_type.md +Oxcaml-Include_functor_argument_shapes-Make-argument-1-T-class-class_.md +Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_type.md +Oxcaml-Include_functor_argument_shapes-Make-class-output_class_via_name.md +Oxcaml-Include_functor_argument_shapes-class-class_type.md +Oxcaml-Include_functor_argument_shapes-class-class_.md Oxcaml-Include_functor_argument_shapes-X.md Oxcaml-Include_functor_argument_shapes-module-type-S.md +Oxcaml-Include_functor_argument_shapes-class-output_class_via_type.md +Oxcaml-Include_functor_argument_shapes-class-output_class_via_name.md +Oxcaml-Include_functor_argument_shapes-Aliased.md +Oxcaml-Include_functor_argument_shapes-Aliased-module-type-To_include_module_type.md +Oxcaml-Include_functor_argument_shapes-Aliased-To_include_module.md Oxcaml-Include_functor_desugared.md Oxcaml-Include_functor_desugared-Make.md Oxcaml-Include_functor_desugared-Make-argument-1-T.md