A value is called polymorphic if, depending on the context where it's used, it can take on more than one type.
Various kinds of polymorphism are identified.
1. Parametric polymorphism; mostly found in functional languages 1. Inclusion polymorphism; mostly found in object oriented languages 1. Ad hoc poolymorphism; typically C++ overloading
1 Haskell Examples
foldr :: forall a b. (a -> b -> b) -> b -> [a] -> b
::(Char ->Int->Int)->Int->String->Int ::(String->String->String)->String->[String]->String
An "integer literal" is polymorphic:
1 :: forall t. (Num t) => t
- On Understanding Types, Data Abstraction, and Polymorphism (1985), by Luca Cardelli, Peter Wegner in ACM Computing Surveys.