Main Page | See live article | Alphabetical index

Type variable

Type variables are a feature in functional programming languages such as Haskell and others.

They enable parametric polymorphic functions to be written. They operate like variables, in that they can represent any type.

For example, with the function length -- to determine the length of a list, it is only necessary to know the amount of elements in the list -- the type of the elements does not count, so the type signature can be represented with a type variable and thus is parametric polymorphic.