Generic function: Difference between revisions

Content deleted Content added
CmdrObot (talk | contribs)
m sp: An other→Another
No edit summary
Line 5:
 
Another, completely separate definition of '''generic function''' is a function that uses parametric polymorphism. This is the definition used when working with a language like [[OCaml]]. An example of a generic function is
<source lang="ocaml">
id: a->a
let id: a = ->a
let id a = a
</source>
which takes an argument of any type and returns something of that same type.