# principal type

Also found in: Wikipedia.

## principal type

The most general type of an expression. For example, the
following are all valid types for the lambda abstraction
(\ x . x):

Int -> Int Bool -> Bool (a->b) -> (a->b)

but any valid type will be an instance of the principal type: a -> a. An instance is derived by substituting the same type expression for all occurences of some type variable. The principal type of an expression can be computed from those of its subexpressions by Robinson's unification algorithm.

Int -> Int Bool -> Bool (a->b) -> (a->b)

but any valid type will be an instance of the principal type: a -> a. An instance is derived by substituting the same type expression for all occurences of some type variable. The principal type of an expression can be computed from those of its subexpressions by Robinson's unification algorithm.

Want to thank TFD for its existence? Tell a friend about us, add a link to this page, or visit the webmaster's page for free fun content.

Link to this page: