
25 Aug
2011
25 Aug
'11
1:41 a.m.
On Aug 24, 2011, at 1:38 PM, Dave Abrahams wrote:
I mean this, for a ternary function f:
f(x) => doesn't call f f(x)(y) => doesn't call f f(x)(y)(z) => calls f
That last step looks asymmetric to me.
In a lazy language, f(x)(y)(z) *doesn't* call f... until you actually use the result for something... which is more consistent-looking.
I suppose the symmetrical non-lazy version looks like:
f(x) => doesn't call f f(x)(y) => doesn't call f f(x)(y)(z) => doesn't call f f(x)(y)(z)() => calls f
What about using [] for currying and () for calling? f[x] => returns binary function f[x][y] => returns unary function f[x][y][z] => returns nullary function All of these have the same effect: f(x, y, z) f[x](y, z) f[x][y](z) f[x][y][z]() Josh