Re:Show HN: Omg-Curry – JavaScript currying library
by ufo on Monday August 10, 2020 @11:24PM
(#24116871)
The add example is a bit boring because all the arguments are the same "kind". Partial evaluation is more interesting if the arguments are more independent. To borrow a contrived example from the Lodash docs, you can use partial evaluation to make a custom greeter function:
https://lodash.com/docs/4.17.15#partial https://lodash.com/docs/4.17.15#curry
Currying works similarly, except that the function by does the partial evaluation automatically if you call it with less arguments.