add map example

This commit is contained in:
darkf 2013-10-22 17:29:39 -07:00
parent d2ad20ff3a
commit a6cdb3b073
1 changed files with 6 additions and 0 deletions

6
examples/map.lamb Normal file
View File

@ -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])).