January 2020
Intermediate to advanced
470 pages
11h 13m
English
Before trying more complex things, we could curry a function by hand, without any special auxiliary functions or anything else. And, in fact, if we just want to implement currying for a special case, there's no need to do anything complex, because we can manage with simple arrow functions: we saw that for both make3curried() and addVATcurried(), so there's no need to revisit that idea.
Instead, let's look into some ways of doing that automatically, so we will be able to produce an equivalent curried version of any function, even without knowing its arity beforehand. Going further, we might want to code a more intelligent version of a function that could work differently depending on the number of received arguments. For example, ...