1 (***********************************************************************)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the Q Public License version 1.0. *)
11 (***********************************************************************)
15 (* Typechecking of type expressions for the core language *)
19 val transl_simple_type
:
20 Env.t
-> bool -> Parsetree.core_type
-> Types.type_expr
21 val transl_simple_type_univars
:
22 Env.t
-> Parsetree.core_type
-> Types.type_expr
23 val transl_simple_type_delayed
:
24 Env.t
-> Parsetree.core_type
-> Types.type_expr
* (unit -> unit)
25 (* Translate a type, but leave type variables unbound. Returns
26 the type and a function that binds the type variable. *)
27 val transl_type_scheme
:
28 Env.t
-> Parsetree.core_type
-> Types.type_expr
29 val reset_type_variables
: unit -> unit
30 val enter_type_variable
: bool -> Location.t
-> string -> Types.type_expr
31 val type_variable
: Location.t
-> string -> Types.type_expr
34 val narrow
: unit -> variable_context
35 val widen
: variable_context
-> unit
37 exception Already_bound
40 Unbound_type_variable
of string
41 | Unbound_type_constructor
of Longident.t
42 | Unbound_type_constructor_2
of Path.t
43 | Type_arity_mismatch
of Longident.t
* int * int
44 | Bound_type_variable
of string
46 | Unbound_class
of Longident.t
47 | Unbound_row_variable
of Longident.t
48 | Type_mismatch
of (Types.type_expr
* Types.type_expr
) list
49 | Alias_type_mismatch
of (Types.type_expr
* Types.type_expr
) list
50 | Present_has_conjunction
of string
51 | Present_has_no_type
of string
52 | Constructor_mismatch
of Types.type_expr
* Types.type_expr
53 | Not_a_variant
of Types.type_expr
54 | Variant_tags
of string * string
55 | Invalid_variable_name
of string
56 | Cannot_quantify
of string * Types.type_expr
58 exception Error
of Location.t
* error
60 val report_error
: formatter
-> error
-> unit