A library for constraint-based Hindley-Milner type inference
Library inferno
Module type Inferno . Signatures . MUNIFIER
type variable

A unifier maintains a graph whose vertices are equivalence classes of variables. With each equivalence class, a piece of information of type data is attached.

type 'a structure

The type 'a structure describes the information that is attached with each class. It is parameterized over a type 'a of children. In the definition of the type data, 'a is instantiated with variable.

type data = variable structure

By definition, data is a synonym for variable structure. So, the data attached with an equivalence class of variables is a structure whose children are variables.

val get : variable -> data

get v is the structure currently attached with the (equivalence class of the) variable v. The structure that is attached with a class can change when the unifier is invoked.