typer.mli 842 Bytes
Newer Older
1
2
3
exception Pattern of string
exception NonExhaustive of Types.descr
exception Constraint of Types.descr * Types.descr * string
4
exception ShouldHave of Types.descr * string
5
6
7

val compile_regexp : Ast.regexp -> Ast.ppat -> Ast.ppat

8
9
10
val register_global_types : (string * Ast.ppat) list -> unit
  (* the global environment is untouched if the function fails *)

11
12
13
val typ : Ast.ppat -> Typed.ttyp
val pat : Ast.ppat -> Typed.tpat

14
15
16
17
18
module Fv : Set.S with type elt = string
module Env : Map.S with type key = string

val expr: Ast.pexpr -> Fv.t * Typed.texpr

19
20
21
22
23
24
25
val type_check: 
  Types.descr Env.t -> Typed.texpr -> Types.descr -> bool -> Types.descr
  (* [compute_type env e t precise] checks that expression [e] 
     has type [t] under typing environment [env]; if [precise=true], 
     also returns a possible more precise type for [e].
  *)