Anonymous user
Parametric polymorphism: Difference between revisions
Add Nimrod
m (Just a couple of null checks.) |
(Add Nimrod) |
||
Line 547:
map(_, empty) = empty.
map(F, node(A, Left, Right)) = node(F(A), map(F, Left), map(F, Right)).</lang>
=={{header|Nimrod}}==
<lang nimrod>type Tree[T] = ref object
value: T
left, right: Tree[T]</lang>
=={{header|OCaml}}==
|