This is an interface with all of the module system features.
This text is centered.
This text is left-aligned.
This text is right-aligned.
This documentation demonstrates:
A numbered list:
- 3
- 2
- 1
David Sheets is the author.
You may find more information about this HTML documentation renderer at github.com/dsheets/ocamlary.
This is some verbatim text:
verbatim
This is some verbatim text:
[][df[]]}}
Here is some raw LaTeX: $e^{i\pi} = -1$
Here is an index table of Empty
modules:
Here is a table of links to indexes: indexlist
Here is some superscript: x2
Here is some subscript: x0
Here are some escaped brackets: { [ @ ] }
Here is some emphasis followed by code
.
An unassociated comment
Level 0
Level 1
Level 2
Level 3
Level 4
Level 5
Level 6
Level 7
Level 8
Level 9
Basic module stuff
module Empty : sig ... end
module type Empty = sig ... end
An ambiguous, misnamed module type
An ambiguous, misnamed module type
Level 9000
module EmptyAlias = Empty
A plain module alias of Empty
EmptySig
A plain, empty module signature
A plain, empty module signature alias of
A plain module of a signature of EmptySig
(reference)
A plain module with an alias signature
There's a signature in a module in this signature.
For a good time, see subSig
or subSig
or SuperSig.EmptySig
. Section Level 9000 is also interesting. EmptySig
is a general reference but EmptySig is the section and EmptySig
is the module signature.
Some text before exception title.
Basic exception stuff
After exception title.
Unary exception constructor
exception Kablam of unit * unit
Binary exception constructor
exception Kapow of unit * unit
Unary exception constructor over binary tuple
type ('a, 'b) a_function = 'a -> 'b
val a_function : x:int -> int
This is a_function
with param and return type.
val fun_maybe : ?yes:unit -> unit -> int
val not_found : unit -> unit
val since_mesozoic : unit
This value was introduced in the Mesozoic era.
This value has had changes in 1.0.0, 1.1.0, and 1.2.0.
This value has a custom tag foo
. @foo the body of the custom foo
tag
Some Operators
Advanced Module Stuff
This comment is for CollectionModule
.
module type MMM = sig ... end
module type A = sig ... end
module type B = sig ... end
module type C = sig ... end
This module type includes two signatures.
This comment is for FunctorTypeOf
.
This comment is for IncludeModuleType
.
Advanced Type Stuff
type record = {
field1 : int;
This comment is for field1
.
field2 : int;
This comment is for field2
.
}
This comment is for record
.
This comment is also for record
.
type mutable_record = {
mutable a : int;
b : unit;
b
is second and immutable
mutable c : int;
}
type universe_record = {
nihilate : 'a. 'a -> unit;
}
type variant =
| TagA
This comment is for TagA
.
| ConstrB of int
This comment is for ConstrB
.
| ConstrC of int * int
This comment is for binary ConstrC
.
| ConstrD of int * int
This comment is for unary ConstrD
of binary tuple.
This comment is for variant
.
This comment is also for variant
.
type poly_variant = [
| `TagA
This comment is for `TagA
.
| `ConstrB of int
This comment is for `ConstrB
.
]
This comment is for poly_variant
.
Wow! It was a polymorphic variant!
This comment is for full_gadt
.
Wow! It was a GADT!
This comment is for partial_gadt
.
Wow! It was a mixed GADT!
This comment is for record_arg_gadt
.
Wow! It was a GADT with record arguments
This comment is for alias
.
This comment is for tuple
.
type variant_alias = variant =
| TagA
| ConstrB of int
| ConstrC of int * int
| ConstrD of int * int
This comment is for variant_alias
.
type record_alias = record = {
field1 : int;
field2 : int;
}
This comment is for record_alias
.
This comment is for poly_variant_union
.
type 'a poly_poly_variant = [
| `TagA of 'a
]
type ('a, 'b) bin_poly_poly_variant = [
| `TagA of 'a
| `ConstrB of 'b
]
type 'a open_poly_variant = [> `TagA ] as 'a
type 'a open_poly_variant2 = [> `ConstrB of int ] as 'a
type 'a poly_fun = [> `ConstrB of int ] as 'a -> 'a
type 'a poly_fun_constraint = 'a -> 'a constraint 'a = [> `TagA ]
type 'a closed_poly_variant = [< `One | `Two ] as 'a
type 'a clopen_poly_variant = [< `One | `Two of int | `Three Two Three ] as 'a
type nested_poly_variant = [
| `A
| `B of [ `B1 | `B2 ]
| `C
| `D of [ `D1 of [ `D1a ] ]
]
This comment is for full_gadt_alias
.
This comment is for partial_gadt_alias
.
exception Exn_arrow : unit -> exn
and mutual_constr_b =
| B
| A_ish of mutual_constr_a
This comment must be here for the next to associate correctly.
type rec_obj = < f : int ; g : unit -> unit ; h : rec_obj >
type 'a open_obj = < f : int ; g : unit -> unit.. > as 'a
type 'a oof = < a : unit.. > as 'a -> 'a
type 'a any_obj = < .. > as 'a
type one_meth = < meth : unit >
A mystery wrapped in an ellipsis
type ext +=
| ExtC of unit
| ExtD of ext
type ext += private
| ExtF
type poly_ext +=
| Foo of 'b
| Bar of 'b * 'b
val launch_missiles : unit -> unit
Rotate keys on my mark...
A brown paper package tied up with string
module Dep1 : sig ... end
module Dep2 (Arg : sig ... end) : sig ... end
module Dep3 : sig ... end
module Dep4 : sig ... end
module Dep5 (Arg : sig ... end) : sig ... end
module Dep6 : sig ... end
module Dep7 (Arg : sig ... end) : sig ... end
module Dep8 : sig ... end
module Dep9 (X : sig ... end) : sig ... end
module Dep11 : sig ... end
module Dep12 (Arg : sig ... end) : sig ... end
module type With1 = sig ... end
module With2 : sig ... end
module With5 : sig ... end
module With6 : sig ... end
module With7 (X : sig ... end) : sig ... end
module With9 : sig ... end
Trying the {!modules: ...} command.
With ocamldoc, toplevel units will be linked and documented, while submodules will behave as simple references.
With odoc, everything should be resolved (and linked) but only toplevel units will be documented.
Weirder usages involving module types
IncludeInclude1.IncludeInclude2
Dep4.T
A.Q
Playing with @canonical paths
val test : 'a CanonicalTest.Base__.List.t -> unit
Some ref to CanonicalTest.Base__Tests.C.t
and CanonicalTest.Base__Tests.L.id
. But also to CanonicalTest.Base__.List
and CanonicalTest.Base__.List.t
Aliases again
Let's imitate jst's layout.
Section title splicing
I can refer to
But also to things in submodules:
{!section:SuperSig.SubSigA.subSig}
: subSig
{!Aliases.incl}
: incl
And just to make sure we do not mess up:
{{!section:indexmodules}A}
: A{{!aliases}B}
: B{{!section:SuperSig.SubSigA.subSig}C}
: C{{!Aliases.incl}D}
: D
New reference syntax
module type M = sig ... end
Here goes:
{!M.t}
: M.t
{!module-M.t}
: M.t
{!module-type-M.t}
: M.t
Some here should fail: