From a6cdb3b0732da7f83d0503eab0fee3d2b468ce5b Mon Sep 17 00:00:00 2001 From: darkf Date: Tue, 22 Oct 2013 17:29:39 -0700 Subject: [PATCH] add map example --- examples/map.lamb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 examples/map.lamb diff --git a/examples/map.lamb b/examples/map.lamb new file mode 100644 index 0000000..08f3132 --- /dev/null +++ b/examples/map.lamb @@ -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])). \ No newline at end of file