\r
import StdEnv\r
\r
-Start = and\r
+/*Start = and\r
[ sum` [1 .. 5] == sum [1 .. 5]\r
, prod` [1 .. 5] == prod [1 .. 5]\r
, flatten` [[],[1],[1,2],[1,2,3]] == flatten [[],[1],[1,2],[1,2,3]]\r
, reverse` [1 .. 5] == reverse [1 .. 5]\r
, takeWhile` ((<>) 0) [1,2,3,0,4,5,6] == takeWhile ((<>) 0) [1,2,3,0,4,5,6]\r
, maxList` [1 .. 5] == maxList [1 .. 5]\r
- ]\r
+ ]*/\r
+Start = takeWhile` ((<>) 0) [1,2,3,0,4,5,6]\r
\r
sum` = foldr (+) 0\r
prod` = foldr (*) 1\r
flatten` = foldr (++) []\r
length` = foldl (\l e = l + 1) 0\r
reverse` = foldl (\xs x = [x:xs]) []\r
-takeWhile` = takeWhile\r
+takeWhile` p = foldr (\x xs = if (p x) [x:xs] xs) []\r
maxList` [] = undef\r
maxList` [x:xs] = foldr max x xs\r