jon.recoil.org

Module Typetexp.TyVarEnv

val reset : unit -> unit

removes all type variables from scope

val with_local_scope : (unit -> 'a) -> 'a

Evaluate in a narrowed type-variable scope

type poly_univars
val make_poly_univars : (string Location.loc * Env.stage) list -> Typetexp.TyVarEnv.poly_univars

A variant of make_poly_univars_jkinds that gets variables without jkind annotations

val make_poly_univars_jkinds : context:(string -> Jkind.History.annotation_context_lr) -> (string Location.loc * Parsetree.jkind_annotation option * Env.stage) list -> Typetexp.TyVarEnv.poly_univars

remember that a list of strings connotes univars; this must always be paired with a check_poly_univars.

val check_poly_univars : Env.t -> Location.t -> Typetexp.TyVarEnv.poly_univars -> Types.type_expr list

Verify that the given univars are universally quantified, and return the list of variables. The type in which the univars are used must be generalised

val instance_poly_univars : Env.t -> Location.t -> Typetexp.TyVarEnv.poly_univars -> Types.type_expr list

Same as check_poly_univars, but instantiates the resulting type scheme (i.e. variables become Tvar rather than Tunivar)