package libsail
Module Libsail.Type_internalSource
Source
type type_variables = {vars : (Ast.l * Ast.kind_aux * type_var_origin) Ast_compare.KBindings.t;shadows : int Ast_compare.KBindings.t;
}Source
type type_error = | Err_no_overloading of Ast.id * (Ast.id * Parse_ast.l * type_error) list| Err_unresolved_quants of Ast.id * Ast.quant_item list * (Ast_util.mut * Ast.typ) Ast_compare.Bindings.t * type_variables * Ast.n_constraint list| Err_failed_constraint of Ast.n_constraint * Parse_ast.l list * (Ast_util.mut * Ast.typ) Ast_compare.Bindings.t * type_variables * Ast.n_constraint list| Err_subtype of Ast.typ * Ast.typ * Ast.n_constraint option * (constraint_reason * Ast.n_constraint) list * type_variables| Err_no_num_ident of Ast.id| Err_other of string| Err_inner of type_error * Parse_ast.l * string * type_error| Err_not_in_scope of string option * Parse_ast.l option * string Project.spanned option * string Project.spanned option * bool * bool| Err_instantiation_info of int * type_error| Err_function_arg of Parse_ast.l * Ast.typ * type_error| Err_no_function_type of {id : Ast.id;functions : (Ast.typquant * Ast.typ) Ast_compare.Bindings.t;
}| Err_unbound_id of {id : Ast.id;locals : (Ast_util.mut * Ast.typ) Ast_compare.Bindings.t;have_function : bool;
}| Err_vector_subrange of {n : Big_int.num;m : Big_int.num;order : Ast.order;
}| Err_hint of string| Err_with_hint of string * type_error| Err_alternate of type_error * (string * Parse_ast.l * type_error) list
Source
val destruct_exist_plain :
?name:??? ->
Ast.typ ->
(Ast.kinded_id list * Ast.n_constraint * Ast.typ) optionSource
val destruct_numeric :
?name:??? ->
Ast.typ ->
(Ast.kid list * Ast.n_constraint * Ast.nexp) optionDestructure and canonicalise a numeric type into a list of type variables, a constraint on those type variables, and an N-expression that represents that numeric type in the environment. For example:
{'n, 'n <= 10. atom('n)}to['n], 'n <= 10, 'n vintto['n], true, 'n(where'nis fresh)atom('n)to[], true, 'n*
Source
val destruct_exist :
?name:??? ->
Ast.typ ->
(Ast.kinded_id list * Ast.n_constraint * Ast.typ) option