Algorithm W

E807600

Algorithm W is a classic type inference algorithm that efficiently computes principal types in the Hindley–Milner type system used by many functional programming languages.

All labels observed (1)

Label Occurrences
Algorithm W canonical 1

How this entity was disambiguated

Statements (46)

Predicate Object
instanceOf algorithm
type inference algorithm
alternativeTo Algorithm J NERFINISHED
constraint-based type inference algorithms
assumes no user-written type annotations are required for basic inference
rank-1 polymorphism (Hindley–Milner polymorphism)
basedOn Hindley–Milner type system NERFINISHED
complexity typically near-linear in size of term for practical programs
computes principal types
coreStep generalizes types at let-bindings
generates type equations
recursively infers types for subexpressions
solves type equations via unification
describedIn "Principal type-schemes for functional programs"
domain programming language theory
static type checking
goal infer most general type without annotations
influenced design of many statically typed functional languages
type inference in Haskell
type inference in ML
input untyped lambda calculus term with let-bindings (Hindley–Milner syntax)
introducedBy Luis Damas NERFINISHED
Robin Milner NERFINISHED
introducedInContextOf type assignment for the Hindley–Milner system
notDesignedFor GADTs
higher-rank polymorphism
type classes (as in full Haskell)
output most general type (principal type) of the term
property complete with respect to Hindley–Milner type system
sound with respect to Hindley–Milner type system
terminating on well-formed inputs
publicationYear 1982 (original Damas–Milner paper)
representation produces type schemes with universally quantified variables
uses type variables for unknown types
supportsFeature let-polymorphism
polymorphic type inference
principal type computation
unification-based constraint solving
usedIn Haskell (core Hindley–Milner fragment) NERFINISHED
ML family of languages NERFINISHED
OCaml (core Hindley–Milner fragment) NERFINISHED
Standard ML NERFINISHED
functional programming languages
usesTechnique environment-based type assignment
substitution
unification

How these facts were elicited

Referenced by (1)

Full triples — surface form annotated when it differs from this entity's canonical label.