repositories
/
fp1415.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Added student numbers
[fp1415.git]
/
week5
/
mart
/
Origami.icl
1
/**
2
* Mart Lubbers, s4109503
3
* Camil Staps, s4498062
4
*/
5
6
module Origami
7
8
import StdEnv
9
10
sum` = foldr (+) 0
11
prod` = foldr (*) 1
12
flatten` = foldr (++) []
13
length` = foldr (\x l=l+1) 0
14
reverse` = foldl (\xs x=[x:xs]) []
15
takeWhile` p = foldr (\x xs=if (p x) [x:xs] []) []
16
maxList` [x:xs] = foldr max x xs