Previous Contents Next
6.8 Type and exception definitions

6.8.1 Type definitions

Type definitions bind type constructors to data types: either variant types, record types, type abbreviations, or abstract data types. They also bind the value constructors and record fields associated with the definition.


type-definition ::= type typedef  { and typedef }
typedef ::= [type-params]  typeconstr-name  [type-information]
type-information ::= [type-equation]  [type-representation]  { type-constraint }
type-equation ::= = typexpr
type-representation ::= = constr-decl  { | constr-decl }
  | = { field-decl  { ; field-decl } }
type-params ::= type-param
  | ( type-param  { , type-param } )
type-