From: Mart Lubbers Date: Fri, 13 Mar 2015 14:33:27 +0000 (+0100) Subject: week5 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=ed56324126e46edce4e1702e92f36a009350f784;p=fp1415.git week5 --- diff --git a/week5/mart/Origami.icl b/week5/mart/Origami.icl index 56fdb86..93d36ef 100644 --- a/week5/mart/Origami.icl +++ b/week5/mart/Origami.icl @@ -2,10 +2,10 @@ module Origami import StdEnv -sum` = foldr (+) 0 -prod` = foldr (*) 1 -flatten` = foldr (++) [] -length` = foldr (\x l=l+1) 0 -reverse` = foldl (\xs x=[x:xs]) [] +sum` = foldr (+) 0 +prod` = foldr (*) 1 +flatten` = foldr (++) [] +length` = foldr (\x l=l+1) 0 +reverse` = foldl (\xs x=[x:xs]) [] takeWhile` p = foldr (\x xs=if (p x) [x:xs] []) [] -maxList` = foldr (\x m=if (m