3 ms·
As someone who likes functional programming, I appreciate .bind as a reasonably convenient way to do partial function application.
by Tcepsa 4y ago
As someone who likes functional programming, I appreciate .bind as a reasonably convenient way to do partial function application.
- golergka 4y agoOne thing I didn't get about functional programming is planning the parameter order in advance for currying them later. Arrow functions may not look as neat as Haskells currying, but you can partially apply any parameter regardless of whether it's first or not, including separate properties of object parameters.
- gherkinnn 4y agoDefaulting to data-last gets you 80% of the way. fn = (a -> b) -> a So your typical array mapping becomes list.map(to(v => v * 2)) All very contrived of course. Ramda’s currying [0] gives you the _ param to play with the order. But I’ve come to the conclusion that currying in JS is rarely worth the effort. [1] 0 - https://github.com/ramda/ramda/blob/v0.28.0/source/__.js https://github.com/ramda/ramda/blob/v0.28.0/source/__.js 1 - https://2ality.com/2017/11/currying-in-js.html https://2ality.com/2017/11/currying-in-js.html