Additional OCaml Theory

This is some information that I think is not in the official OCaml manual. Nor is it easily deduced therefrom. I think that such information is vital to understanding the language and is available only haphazardly in the OCaml literature, and perhaps not even there.

Scope of type constructors and parameters

Somewhere around here:

A typeconstr-name within a typedef within a type-definition within a struct … end construct within a module-expr is a new type constructor name whose scope is the following definitions and exprs of the struct … end. [One of the two following texts:]

A sequence of specifications may appear in

Each typedef of a type-definition among the specifications of such a sequence introduces a new type constructor name whose scope is:

I would be relieved if the word ‘Only’ were inserted before the sentence beginning: “These type parameters can appear” in section 6.8.1.


For a module to match a module signature, the typeconstr-name of each tyedef of the signature, most appear as a typeconstr-name of some tyedef of the module.
Info from there needs sharpening and inclusion here. This is alternate terminology.