repositories
/
cc1516.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1fde17a
)
curry gotcha
master
author
pimjager
<pim@pimjager.nl>
Thu, 23 Jun 2016 13:59:23 +0000
(15:59 +0200)
committer
pimjager
<pim@pimjager.nl>
Thu, 23 Jun 2016 13:59:23 +0000
(15:59 +0200)
examples/demo/curryGotcha.spl
[new file with mode: 0644]
patch
|
blob
diff --git a/examples/demo/curryGotcha.spl
b/examples/demo/curryGotcha.spl
new file mode 100644
(file)
index 0000000..
5fe72ba
--- /dev/null
+++ b/
examples/demo/curryGotcha.spl
@@ -0,0
+1,17
@@
+main() {
+ var plus = \x y z -> x + y + z;
+ var ap = \f x -> f(x);
+
+ //this is fine:
+ var p3 = plus(2,1); //also fine
+ var res = ap(p3, 3); //6
+
+ //this breaks the stack
+ //var res = ap(plus(2,1), 3);
+ //also breaks the stack:
+ //var p2 = plus(2);
+ //var p3 = p2(1);
+ //var res = ap(p3, 3); //6
+
+ print(res);
+}
\ No newline at end of file