Next - Previous     
    Overview        Class Hierarchy        Types of Polymorphism          Resources

Parametric Polymorphism:

Parametric polymorphism was the first type of polymorphism developed, first identified
by Christopher Strachey in 1967

Using parametric polymorphism, a function or data type can be written generically so
that it can deal equally well with objects of various types.

Example:

For example, a function append that joins two lists can be constructed so that it does not depend
on one particular type of list: it can append lists of integers, lists of real numbers, lists of strings, and
so on. Let a denote the type of elements in the lists. Then
append can be typed [a] × [a] → [a],
where [a] denotes a list of elements of type a. We say that
append is parameterized by a.