repositories
/
cc1516.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Working lambdas uitroepteken
[cc1516.git]
/
examples
/
tempTest.spl
1
//plus(x,y){
2
// return x+y;
3
//}//
4
5
map(f, xs) {
6
if (isEmpty(xs)) {
7
return [];
8
} else {
9
return f(xs.hd) : map(f, xs.tl);
10
}
11
}
12
13
//foldr(f, acc, xs) {
14
// if(isEmpty(xs)) {
15
// return acc;
16
// } else {
17
// return foldr(f, f(xs.hd, acc), xs.tl);
18
// }
19
//}
20
21
main() {
22
var f = \x -> x+1;
23
var z = map(\x->x+1, 1:2:[]);
24
//var x = foldr(plus, 0, 1:2:[]);
25
//print(x);
26
return;
27
}