ocaml-doc / doc-ock

(DEPRECATED) Documentation generation for OCaml
ISC License
15 stars 4 forks source link

CoreType and CoreException #6

Closed dsheets closed 10 years ago

dsheets commented 10 years ago

What do CoreType and CoreException represent? Are they types and exceptions from Pervasives? Why are they special?

lpw25 commented 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.

lpw25 commented 10 years ago

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.

dsheets commented 10 years ago

Why don't they have aliases in Pervasives?

lpw25 commented 10 years ago

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.

dsheets commented 10 years ago

Tracked by http://caml.inria.fr/mantis/view.php?id=6655.

lpw25 commented 10 years ago

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.

dsheets commented 10 years ago

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.