Closed dsheets closed 10 years ago
They are the types and exceptions that are predefined in OCaml (see here). Unlike everything else in OCaml (including the members of Pervasives
) they do not live inside a module, so their paths are represented differently from everything else.
By the way, the reason they exist is so that they can be handled specially by the compiler. For example option
is needed for default arguments, and Match_failure
can be raised by the pattern matching code.
Why don't they have aliases in Pervasives
?
Why don't they have aliases in Pervasives?
No good reason. It might be a good idea to suggest that on Mantis, as it would be useful for referring to e.g. Pervasives.int
in a context where someone has redefined int
.
Tracked by http://caml.inria.fr/mantis/view.php?id=6655.
Note that there is now DocOck.core_types
and DocOck.core_exceptions
which includes definitions for all the builtin types and exceptions -- including their documentation from that page in the OCaml manual.
Is it possible to write those definitions as a module signature or at least a set of files for each name? I'm thinking that, as it is, it will be difficult to provide translations of the documentation or to use it as a component of the rendering of a manual.
I'd really like to avoid these special cases at all costs.
What do
CoreType
andCoreException
represent? Are they types and exceptions fromPervasives
? Why are they special?