3 ms·
I don't think "curry" is quite the right name for that function. For a function int f(int, int, int); the curried version of f, auto f_curried = cur
by panic 13y ago
I don't think "curry" is quite the right name for that function. For a function
int f(int, int, int);
the curried version of f,
auto f_curried = curry(f);
must be able to take multiple arguments one-at-a-time, so
f_curried(x)(y)(z) == f(x, y, z)
The code at https://dpaste.de/a8g9D/ https://dpaste.de/a8g9D/ just partially applies the function to one set of arguments, which isn't enough -- you have to keep partially applying until you get them all.
- mihai_ionic 13y agoI knew I should have just called it bind. As a bonus, an actual implementation of curry: https://dpaste.de/qGWcq/ https://dpaste.de/qGWcq/