module Code: sig .. end
Definitions and library for the emitted AST
type lident = Longident.t
Lowercase ident.
type uident = Longident.t
Uppercase ident.
type iident = Longident.t
Infix ident.
type ident = Longident.t
Any kind of ident.
type iname = string
The name of an infix symbol.
type tname = string
The name of a type declared in the AST.
type filename = string
type exp =
type pattern = exp
type clause =
type clauses = clause list
type structure_item =
type structure = structure_item list
val underscored_ocaml_pattern : Parsetree.pattern -> Parsetree.pattern
val underscored_pattern : exp -> exp
val underscored_clause : clause -> clause
val prefix_longident : string -> Longident.t -> Longident.t
To add a prefix string to a qualified (long) identifier.
val topletrec : (lident * pattern list * exp) list -> structure_item
To define a toplevel let rec definition in a module implementation.
Globally predefined identifiers.
val underscore : pattern
val x : exp
val y : exp
val z : exp
val t : exp
val u : exp
val xs : exp
When binding a list of arguments.
val genr_args : string -> int -> pattern list
genr_args root n returns the list of patterns root1; ...; rootn.
val genr_numbered_args : string -> int -> (int * exp) list
genr_numbered_args root n returns 1, root1; ...; n, rootn.
val genr_underscores : int -> pattern list
genr_underscores n returns a list of n _ patterns.
val make_Constant : string -> exp
Generate a constant expression from the given string.
val make_Var : string -> exp
Generate a variable expression from the name of the given ident.
Application macros
val apply : lident -> exp list -> exp
val apply1 : lident -> exp -> exp
val apply2 : lident -> exp -> exp -> exp
val apply3 : lident -> exp -> exp -> exp -> exp
Apply an ident to its argument(s).
val infix_apply : exp -> iident -> exp -> exp
Apply an infix ident to its arguments.
val infix_name : exp -> iname -> exp -> exp
Apply a given infix name to its arguments.
Other useful auxiliaries
val let0 : lident -> exp -> exp -> exp
val let1 : lident -> pattern -> exp -> exp -> exp
val pair : exp -> exp -> exp
val raise_error : string -> exp
val division_by_absorbent : exp
val failure_division_by_absorbent : exp
val failwith_division_by_absorbent : exp
val sequence : exp -> exp -> exp