Module Otype


module Otype: sig .. end

Functions on OCaml types.



val opposite : Parsetree.relation_side -> Parsetree.relation_side

Converting longident and generator into string


val name_of_longident : Longident.t -> string
val name_of_generator : Parsetree.generator -> string
val qualified_name_of_longident : Longident.t -> string
val qualified_name_of_generator : Parsetree.generator -> string

Functions building relations
val mk_rel : Parsetree.rel_desc -> Parsetree.relation

Functions building core types


val mk_type : Parsetree.core_type_desc -> Parsetree.core_type
val var_type : string -> Parsetree.core_type
val constr_type : string -> Parsetree.core_type list -> Parsetree.core_type
val poly_type : string -> string list -> Parsetree.core_type
val constant_type : string -> Parsetree.core_type
val bool_type : Parsetree.core_type
val arrow_type : Parsetree.core_type -> Parsetree.core_type -> Parsetree.core_type
val tuple_type : Parsetree.core_type list -> Parsetree.core_type
val list_type : Parsetree.core_type -> Parsetree.core_type
val type_of_eq : string -> string list -> Parsetree.core_type
val projection_type : string -> string list -> Parsetree.core_type -> Parsetree.core_type
val injection_type : string -> string list -> Parsetree.core_type -> Parsetree.core_type

Functions testing/accessing core types.
val is_type_list : Parsetree.core_type -> bool
val argument_of_type_list : Parsetree.core_type list -> Parsetree.core_type
Returns the type argument of the Caml compiler list type functional type constructor. Raises Invalid_argument if the argument is not the Pervasives.list type constructor or the list of type arguments has not exactly on type.
val eq_type : Parsetree.core_type -> Parsetree.core_type -> bool
Syntactic equality ignoring locations
val compare_core_type : Parsetree.core_type -> Parsetree.core_type -> int
Comparison on core types (ignore locations).
val subst : (string * Parsetree.core_type) list ->
Parsetree.core_type list -> Parsetree.core_type list
Given an association mapping variable names to core types, applies it to the given core type list as a substitution

Functions on type declarations.


val add_rules : Parsetree.relation list -> Parsetree.relations -> Parsetree.relations
val remove_rules : Parsetree.relations -> Parsetree.relations
val remove_rules_in_type_declaration : Parsetree.type_declaration -> Parsetree.type_declaration
val comment_relations_in_type_declaration : Parsetree.type_declaration -> Parsetree.type_declaration
val make_public_type_declaration : Parsetree.type_declaration -> Parsetree.type_declaration
val get_structure_items_of_type_declaration : Parsetree.type_declaration -> Parsetree.structure_item list
val is_variant_type_declaration : Parsetree.type_declaration -> bool
val is_private_type_declaration : Parsetree.type_declaration -> bool
val is_private_variant_type_declaration : Parsetree.type_declaration -> bool

Functions on constructor definitions.


type constructor_definition = string * Parsetree.core_type list * Parsetree.relations * Location.t 
val generator_of_cdef : constructor_definition -> Parsetree.generator
val relations_of_cdef : constructor_definition -> Parsetree.relations
val arity_of_cdef : constructor_definition -> int
val has_relations : Parsetree.relations -> bool
val has_relations_cdef : constructor_definition -> bool
val has_relations_cdefs : constructor_definition list -> bool

Simplify a list of relations: if a relation occurs both as Left and Right, then it is replaced by Both.
val norm : Parsetree.relations -> Parsetree.relations

Functions building patterns


val mk_pat : Parsetree.pattern_desc -> Parsetree.pattern

Functions building expressions


val mk_exp : Parsetree.expression_desc -> Parsetree.expression
val mk_when : Parsetree.expression -> Parsetree.expression -> Parsetree.expression
val mk_apply : Parsetree.expression -> Parsetree.expression list -> Parsetree.expression
val mk_ident : string -> Parsetree.expression