6 lines
No EOL
105 B
Text
6 lines
No EOL
105 B
Text
map(f, []) -> [].
|
|
map(f, x::xs) -> f(x) :: map(f, xs).
|
|
|
|
double(y) -> y*2.
|
|
|
|
print(map(double, [1, 2, 3])). |