Module Generic_core_desc

module Generic_core_desc: sig .. end
Type description: a low level generic view of OCaml types.

This module defines the datatype part of the generic view: 'a desc. The module Generic_core_desc_fun defines the function part of the generic view: Generic_core_desc_fun.view : 'a ty -> 'a desc returns the type description of a type code.

The type description reflects the definition of a type: it gives information such as:

For each category, further information is given: for variant types, we may access the list describing their constructors, their names and the types of their arguments. For record types we may access a list describing their fields, their names and types. Et cetera.


Records

A record type is described as a set of fields, each field is described by its name, type and a procedure to update its value if it is mutable.

To complete the description of a record type, it is associated to a product type and an isomorphism to convert between the record and the product.

module Field: sig .. end
Generic representation of a record field.
module Fields: sig .. end
Generic representation of a record's collection of fields.
module Record: sig .. end
Generic representation of record datatypes.

Variants


module Con: sig .. end
Generic representation of variant constructors.
module Variant: sig .. end
Generic representation of variant datatypes.
module Ext: sig .. end
Generic representation of extensible variants.
module Poly: sig .. end
Generic representation of polymorphic variants.

Rest


module Method: sig .. end
Generic representation of an object's or a classe's method.
module Object: sig .. end
Generic representation of a collection of methods.
module Class: sig .. end
Generic representation of a class.
module Array: sig .. end
Generic representation of array-like datatypes.
module Custom: sig .. end
Generic representation of custom datatypes.

Type description

A low level generic view of ocaml types. Types fall in nine categories each with its specific description.

module T: sig .. end
One may open T to bring constructor names in scope, typically for pattern-matching.
type 'a desc = 'a T.desc = 
| Array : 'e Ty.T.ty
* (module Array.intf with type elt = 'e and type t = 'a0)
-> 'a0 desc
| Product : 'ts Product.t * ('ts, 'p) Fun.iso -> 'p desc
| Record : ('p0, 'r) Record.t -> 'r desc
| Synonym : 'a1 Ty.T.ty * ('a1, 'b) Equal.t -> 'b desc
| Variant of 'a Variant.t
| Extensible of 'a Ext.t
| Custom of 'a Custom.t
| Class of 'a Class.t
| Abstract
| NoDesc
type 'a t = 'a T.desc