repositories
/
cc1516.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
curry gotcha
[cc1516.git]
/
examples
/
demo
/
curryGotcha.spl
1
main() {
2
var plus = \x y z -> x + y + z;
3
var ap = \f x -> f(x);
4
5
//this is fine:
6
var p3 = plus(2,1); //also fine
7
var res = ap(p3, 3); //6
8
9
//this breaks the stack
10
//var res = ap(plus(2,1), 3);
11
//also breaks the stack:
12
//var p2 = plus(2);
13
//var p3 = p2(1);
14
//var res = ap(p3, 3); //6
15
16
print(res);
17
}