add map example
This commit is contained in:
parent
d2ad20ff3a
commit
a6cdb3b073
|
@ -0,0 +1,6 @@
|
||||||
|
map(f, []) -> [].
|
||||||
|
map(f, x::xs) -> f(x) :: map(f, xs).
|
||||||
|
|
||||||
|
double(y) -> y*2.
|
||||||
|
|
||||||
|
print(map(double, [1, 2, 3])).
|
Loading…
Reference in New Issue