3 Types:
- Ad-hoc polymorphism
- Parametric polymorphism
- Subtype polymorphism (or inclusion polymorphism)
Parametric polymorphism: Parametric polymorphism allows a function or a data type to be written generically, so that it can handle values identically without depending on their type.[4] Parametric polymorphism is a way to make a language more expressive, while still maintaining full static type-safety.
Parametric polymorphism is ubiquitous in functional programming, where it is often simply referred to as "polymorphism". The following example shows a parametrized list data type and two parametrically polymorphic functions on them:
Look further into Type Theory.
In mathematics, logic, and computer science, type theory generally refers to a class of formal systems, some of which can serve as alternatives to naive set theory as a foundation for all mathematics. In type theory, every "term" has a "type" and operations are restricted to terms of a certain type.
http://en.wikipedia.org/wiki/Type_theory
No comments:
Post a Comment