Skip to content

Commit 468ab02

Browse files
line edit features.mld (#1172)
* line edit features.mld * remove extra space * Removed "then" to make sentence accurate * reverted to "given the following: * changed "to" to "of" * changed "to" to "of" * change module-type to [module type} when adj. * apply agreed changes
1 parent dd5cbd3 commit 468ab02

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

doc/features.mld

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
[odoc] works by taking module interfaces, processing them to make them more
44
useful, and turning them into documentation. This processing is largely {{!hiding}hiding}, handling of {{!canonical}
5-
canonical references}, {{!expansion}expansion} and {{!resolution}resolution}.
5+
canonical references}, {{!expansion}expansion}, and {{!resolution}resolution}.
66
This document explains the features of these processes in detail.
77

88
{1:hiding Hiding}
99

1010
Some items are not intended to be used directly but are present as
11-
implementation detail, e.g., for testing, for implementing Dune's namespacing, or other reasons.
11+
implementation detail, e.g., for testing, implementing Dune's namespacing, or other reasons.
1212

1313
There are two mechanisms for explicitly hiding elements from the final
1414
output. The first is to use {{:https://ocaml.org/manual/ocamldoc.html#ss:ocamldoc-stop}documentation stop comments},
@@ -20,15 +20,15 @@ mechanism is only used for modules and is a naming convention. If any module has
2020
Occasionally it’s useful to declare an item in one place and expose
2121
it in the public interface in another. In order to prevent unwanted occurrences
2222
of the actual definition site, [odoc] has a feature whereby the 'canonical'
23-
location of a module, module type or type can be specified.
23+
location of a module, module type, or type can be specified.
2424

25-
The biggest user of module aliases is Dune's {{:https://dune.readthedocs.io/en/stable/dune-files.html#library}wrapped libraries}.
25+
The biggest user of module aliases is Dune's {{:https://dune.readthedocs.io/en/stable/reference/dune/library.html#library}wrapped libraries}.
2626
This feature allows Dune to produce a library whose interface is exposed entirely
2727
though a single top-level module. It does this by mangling the names of the
2828
real implementation modules and generating the single top-level module that
2929
simply contains aliases to the these implementation modules. With [odoc]'s
30-
canonical modules feature all references to the implementation modules are
31-
rewritten to point at the aliases in the top-level module instead. Please
30+
canonical modules feature, all references to the implementation modules are
31+
rewritten to point at the top-level module aliases instead. Please
3232
see the section on Dune's
3333
{{!page-dune.library_wrapping}library wrapping} for more detail.
3434

@@ -64,7 +64,7 @@ in which [odoc] has to treat specially.
6464

6565
{2:expansion_aliases Aliases}
6666

67-
In general [odoc] doesn’t expand module aliases unless they are an
67+
In general, [odoc] doesn’t expand module aliases unless they are an
6868
alias to a hidden module. If this is the case, the right-hand side of
6969
the declaration is dropped and replaced with [sig ... end], and
7070
the expansion is created.
@@ -82,7 +82,7 @@ module Alias = Hidden__module
8282

8383
]}
8484

85-
the [Hidden__module] module won’t be present in the output, and
85+
The [Hidden__module] module won’t be present in the output, and
8686
the [Alias] module will be rendered as if it were a simple
8787
signature. This can be seen in the example rendering {{!Odoc_examples.Expansion.Aliases}here}.
8888

@@ -106,13 +106,13 @@ end
106106
module type B = A
107107
]}
108108

109-
For these simple module type declarations, where the right-hand side is just a
109+
For these simple [module type] declarations, where the right-hand side is just a
110110
path, [odoc] treats them as module aliases and doesn’t produce an expansion.
111111
This example is rendered {{!Odoc_examples.Expansion.ModuleTypeAliases}here}.
112112

113-
When strengthening, OCaml turns modules into aliases to the original
113+
When strengthening, OCaml turns modules into aliases of the original
114114
module, but nothing is done to module types. In contrast, [odoc] replaces
115-
module types with 'aliases' to the originals, too. These are not expanded, hence this is important for reducing the size of the output.
115+
module types with 'aliases' of the originals, too. These are not expanded, hence this is important for reducing the size of the output.
116116

117117
The following examples use [module type of struct include ... end] to
118118
obtain the strengthened signature of [A] (see the {{!module_type_of}[Module Type Of]}
@@ -298,7 +298,7 @@ type foo
298298
module M : MODTYPE with type X.t = foo
299299
]}
300300

301-
the {{!Odoc_examples.Expansion.DeepEquality2.M}expansion of M} does not contain any [with type] equations.
301+
The {{!Odoc_examples.Expansion.DeepEquality2.M}expansion of M} does not contain any [with type] equations.
302302

303303
{2 Substitution}
304304

@@ -307,7 +307,7 @@ for types and modules to be {e destructively} substituted, so the
307307
type or module is entirely removed from the resulting signature.
308308

309309
As with the addition of equations above, these substitutions may be on
310-
deeply nested modules, and care needs to be taken to ensure that there are
310+
deeply nested modules. Care must be taken to ensure that there are
311311
no references to the removed module or type left. For example:
312312

313313
{[
@@ -329,8 +329,8 @@ module M: sig type t end with type t := int
329329
type t = M.t
330330
]}
331331

332-
From this expansion it is still clear how to resolve the right-hand side
333-
of [type t = M.t], and the next phase of [odoc]'s transformation turns the
332+
From this expansion, it is still clear how to resolve the right-hand side
333+
of [type t = M.t]. The next phase of [odoc]'s transformation turns the
334334
right-hand side of [M.t] into [int].
335335

336336
In the output documentation, the declaration of [module M] is rendered
@@ -340,8 +340,8 @@ simply as
340340
module M : sig ... end
341341
]}
342342

343-
with the type substitution dropped. This is because the type substitition on
344-
the simple signature isn't useful for the reader; the link [t] would
343+
with the type substitution dropped. This is because the simple signature's type substitition
344+
isn't useful for the reader. The link [t] would
345345
have no destination. This example is rendered {{!Odoc_examples.Expansion.TypeSubstitution}here}.
346346

347347

@@ -350,7 +350,7 @@ have no destination. This example is rendered {{!Odoc_examples.Expansion.TypeSub
350350
The OCaml construct [module type of] allows the type of a module to be
351351
recovered. As usual, when OCaml performs this operation, it only retains
352352
the simplified signature, stripped of comments, includes, and more
353-
complex module type expressions. As with the previous sections, [odoc]
353+
complex [module type] expressions. As with the previous sections, [odoc]
354354
tries a little harder to keep track of these things and also of the
355355
fact that the signature came from a [module type of] expression.
356356

@@ -367,7 +367,7 @@ end
367367
module M : module type of A
368368
]}
369369

370-
the [type t] in module [M] has the comment from the original module.
370+
The [type t] in module [M] has the comment from the original module.
371371
There is also logic in [odoc] to manage the similar construct
372372
[module type of struct include ... end], which is used where the types
373373
and modules are required to be strengthened. That is, the types in
@@ -411,9 +411,9 @@ module type S =
411411
end
412412
]}
413413

414-
whereas [odoc] preserves the fact that [Y] and [Z] are calculated from [X]. If the
414+
On the other hand, [odoc] preserves the fact that [Y] and [Z] are calculated from [X]. If the
415415
module [X] is subsequently replaced using a destructive substitution on [S], the
416-
results would be different. Given the following,
416+
results would be different. For example:
417417

418418
{[
419419
module X1 : sig
@@ -424,7 +424,7 @@ end
424424
module type T = S with module X := X1
425425
]}
426426

427-
then the signature of [T] as calculated by OCaml will be
427+
The signature of [T], as calculated by OCaml, will be
428428

429429
{[
430430
sig
@@ -440,8 +440,8 @@ There is logic in [odoc] to handle this correctly, but since there is currently
440440
syntax for representing transparent ascription, the consequence is that we lose
441441
the fact that [Y] and [Z] originally came from [module type of] expressions.
442442

443-
This example is rendered {{!Odoc_examples.Expansion.ModuleTypeOfComplications}here},
444-
and in the {{!Odoc_examples.Expansion.ModuleTypeOfComplications.T}expansion of T}, it
443+
This example is rendered {{!Odoc_examples.Expansion.ModuleTypeOfComplications}here}.
444+
In the {{!Odoc_examples.Expansion.ModuleTypeOfComplications.T}expansion of T}, it
445445
can be seen that [Y] and [Z] are simple signatures only containing [type t].
446446

447447

@@ -462,7 +462,7 @@ to an element within a module type, and [module-M] and [module-M.module-X.type-t
462462
identifiers; however, unlike paths, they are not checked by the compiler and are entirely
463463
resolved by [odoc].
464464

465-
In most of the output formats, [odoc] supports paths; references and fragments will be
465+
In most of the output formats, [odoc] supports paths. References and fragments will be
466466
turned into links that take the reader to the referred identifier. These
467467
links need to consider some of the expansions’ features,
468468
as outlined above. In order to decide where the links should point to and how to
@@ -512,8 +512,8 @@ mechanism. This example is demonstrated {{!Odoc_examples.Resolution.HiddenAlias}
512512
When encountering a module, module type, or a type that has been marked with a
513513
[@canonical] tag, [odoc] first has to check that the specified canonical path
514514
actually resolves. If this is the case, in a similar way to the alias above, the
515-
target of the path will be rewritten to point to the canonical path.
516-
However, in contrast to the alias behaviour, the {e text} of the path will
515+
path's target will be rewritten to point to the canonical path.
516+
However, in contrast to the alias behaviour, the path's {e text} will
517517
also be rewritten, so it will be as if the canonical path had been written instead
518518
of whatever path was actually there.
519519

@@ -544,7 +544,7 @@ written by the author, they’re assumed to point to the correct destination.
544544

545545
{2 Fragment Resolution}
546546

547-
Fragments are relative paths that appear in module type expressions when
547+
Fragments are relative paths that appear in [module type] expressions when
548548
adding equations or substituting types or modules. For example:
549549

550550
{[
@@ -588,12 +588,12 @@ type w = U of u
588588
]}
589589

590590
[type v] will have a right-hand side of [T of int], as the hidden [type t] is
591-
equal to [int]; whereas, there is no non-hidden type equivalent to [u], so the
591+
equal to [int]. Conversely, there is no non-hidden type equivalent to [u], so the
592592
right-hand side of [type w] is omitted from the output.
593593

594594
{2:reference_resolution Reference Resolution}
595595

596-
References are hand-written in comments and not evaluated in any way by the
596+
References are handwritten in comments and not evaluated in any way by the
597597
compiler.
598598

599599
{[

0 commit comments

Comments
 (0)