This module defines type analysis routines for pretypes and preterms, used in parsing and printing type/term quotations. The primary routines are detyping, type unification, type inference and type consistency check. This module is used in the implementation of the pretty printer, and is a trusted component of the system.
Type | Description |
Function or value | Description |
Full Usage:
annot_error
Returns: string * string
|
|
Full Usage:
arity_error (x, n1, n2)
Parameters:
string
n1 : 'a
n2 : 'b
Returns: string * string
|
|
|
This takes two pretypes and returns an old-to-new instn list for generated tyvars, calculated by comparing corresponding subcomponents of the pretypes. This instn list is not necessarily closed (i.e. it may need to be applied repeatedly until it makes no change) and may contain inconsistencies when when the two pretypes cannot be unified (instead of failing). These are dealt with by instantiation closure (see below). |
|
|
|
|
|
|
|
|
Full Usage:
fun_error1
Returns: string * string
|
|
Full Usage:
fun_error2
Returns: string * string
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
overload_error x
Parameters:
string
Returns: string * string
|
|
Full Usage:
pretype_gvar_counter
Returns: int ref
|
|
|
|
Full Usage:
reset_pretype_gvar_counter ()
Parameters:
unit
|
|
|
|
|
|
|
|
Full Usage:
type_err msg
Parameters:
string
Returns: 'a
|
|
Full Usage:
type_fail_info msg
Parameters:
'a
Returns: string * 'a
|
|
Full Usage:
types_error
Returns: string * string
|
|
|
|
Unifies any generated tyvars in input pretypes 'pty1' and 'pty2', to result in either a closed pretype instn list for making them equal, or failure (when the pretypes cannot be unified). In 'unify_pretypes0', the unification is carried out wrt input pretype instn list 'theta0', and the result incorporates 'theta0' (but with its range instantiated according to the unification). Note that 'theta0' is assumed to be closed. |
|
|
|
|
|
|
|