4 ms·
Very cool! I'm surprised by this one: https://bloomberg.github.io/bucklescript/js-demo/#Curry_Optimization https://bloomberg.github.io/bucklescript/js-demo/#C
by nothrabannosir 10y ago
Very cool!
I'm surprised by this one:
https://bloomberg.github.io/bucklescript/js-demo/#Curry_Optimization https://bloomberg.github.io/bucklescript/js-demo/#Curry_Opti...
Why doesn't it actually curry? Impressive output, don't get me wrong. But given how native and idiomatic currying is in Javascript, and how much trouble I'd expect this to have taken to implement... is there a specific reason for this? Just curious.
Anyway, again: very impressive. Thanks.
EDIT clarification: I expected:
function f(param) {
return curry(32, param);
}
(or is this to highlight the difference between currying and partial function application?)
- ycitm 10y agoLooks like it's just an optimization. If you change to let test_curry x y = x + y + x You get the expected output function f(param) { return test_curry(32, param); }
- hongbo_zhang 10y agobtw, we also have native uncurried calling convention support to make callback even more efficient