Parametric polymorphism: Difference between revisions

Line 193:
 
=={{header|Genyris}}==
Genyris is a dynamically typed language with optional type checking. Since types are used heavily with tagging, parametric types are usefluseful. Here's a simple function which adds to expressions if type "a" and returns a result with the same type:
<lang python>def add (a x y)
x : a ; type checks
x : a
y : a
tag a (+ a b)</lang>
 
=={{header|Haskell}}==
 
Anonymous user