week 5
authorMart Lubbers <mart@martlubbers.net>
Tue, 10 Mar 2015 10:18:55 +0000 (11:18 +0100)
committerMart Lubbers <mart@martlubbers.net>
Tue, 10 Mar 2015 10:18:55 +0000 (11:18 +0100)
week5/mart/Origami.icl [new file with mode: 0644]

diff --git a/week5/mart/Origami.icl b/week5/mart/Origami.icl
new file mode 100644 (file)
index 0000000..56fdb86
--- /dev/null
@@ -0,0 +1,11 @@
+module Origami\r
+\r
+import StdEnv\r
+\r
+sum`         = foldr (+) 0\r
+prod`        = foldr (*) 1\r
+flatten`     = foldr (++) []\r
+length`      = foldr (\x l=l+1) 0\r
+reverse`     = foldl (\xs x=[x:xs]) []\r
+takeWhile` p = foldr (\x xs=if (p x) [x:xs] []) []\r
+maxList`     = foldr (\x m=if (m<x) x m) 0\r