substitutiontype
Substitutiontype is a term used in formal type systems to describe the mechanism by which type variables are replaced with concrete types in order to instantiate polymorphic expressions. In languages with parametric polymorphism, types may be expressed with variables such as α or β. A substitution type, or simply a substitution, is a finite mapping from type variables to types. The notation T[σ] denotes the type T after applying the substitution σ. The most common form is a mapping {α → τ, β → κ}.
Applying a substitution means replacing every occurrence of a type variable with its bound type, typically
Substitutions underpin type inference and unification algorithms, as they allow the instantiation of generic definitions and
Potential pitfalls include the occurs check, which prevents infinite types, and the need to rename bound variables