package liquidsoap-lang

  1. Overview
  2. Docs

Functions for typing

val debug_subtyping : bool Stdlib.ref

Print debugging messages for subtyping.

val filter_vars : (Type.var -> bool) -> Type.t -> Type.var list

Find all the free variables satisfying a predicate.

type env = (string * Type.scheme) list

A typing environment.

val instantiate : level:int -> Type.scheme -> Type.t

Instantiate a type.

val generalize : level:int -> Type.t -> Type.scheme

Find all generalizable variables.

val update_level : int -> Type.t -> unit

Lower all type variables to given level.

val (<:) : Type.t -> Type.t -> unit

Subtyping.

val (>:) : Type.t -> Type.t -> unit

Suptyping.

val sup : pos:Pos.Option.t -> Type.t -> Type.t -> Type.t

Supremeum of two types.

val bind : ?variance:Type.variance -> Type.t -> Type.t -> unit

Bind a variable

val satisfies_constraint : Type.t -> Type.constr -> unit

Ensure that a type satisfies a given constraint, i.e. morally that b <: c.

val do_occur_check : bool Stdlib.ref
OCaml

Innovation. Community. Security.