Module Generic_core.Desc

module Desc: Generic_core_desc
A low level generic view of OCaml types.


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