Parameter order
There's a problem that's common to not only functions such as Underscore's or LoDash's _.map(list, mappingFunction) or _.reduce(list, reducingFunction, initialValue), but also to some that we have produced in this book, such as the result of demethodize(), for example. (See the Demethodizing - turning methods into functions section of Chapter 6, Producing Functions – Higher-Order Functions, to review that higher-order function.) The problem is that the order of their parameters doesn't really help with currying.
When currying a function, you will probably want to store intermediate results. When we do something like in the code that follows, we assume that you are going to reuse the curried function with the fixed argument ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access