Monomorphization of type definitions
To support the generation of annotations for types that are created during the monomorphization process, a mapping must be kept connecting the monomorphic type name to the original polymorphic one, including its original number of parameters.
This table is only used in producing those annotations to support the Atdgen command line option -o-name-overlap. It can probably be ignored for most uses of expand_module_body.
Monomorphization of type expressions.
"_"
.
false
.
false
.type ('a, 'b) t = [ Foo of 'a | Bar of 'b ] type int_t = (int, int) t
type int_t = _1 type _1 = [ Foo of int | Bar of int ]
type x = { x : int list } type y = { y : int list option }
type x = { x : _1 } type y = { y : _2 } type _1 = int list (* `int list' now occurs only once *) type _2 = _1 option
keep_poly
option allows to return parametrized type definitions as
well.type 'a abs = abstract type int_abs = int abs type 'a tree = [ Leaf of 'a | Node of ('a tree * 'a tree) ] type t = int tree type x = [ Foo | Bar ] tree
type "int abs" = int abs type int_abs = "int abs" type 'a tree = [ Leaf of 'a | Node of ('a tree * 'a tree) ] (* only if keep_poly = true *) type "int tree" = [ Leaf of int | Node of ("int tree" * "int tree") ] type t = "int tree" type "[ Foo | Bar ] tree" = [ Leaf of [ Foo | Bar ] | Node of ("[ Foo | Bar ] tree" * "[ Foo | Bar ] tree") ] type x = "[ Foo | Bar ] tree"