News for hackers. Stuff that matters.
Re:Higher-Order Functions in JavaScript by k__ on Wednesday February 25, 2015 @10:30AM (#9107150)
But for a functional library it has strange argument ordering.
Re:Higher-Order Functions in JavaScript by flannelhead on Wednesday February 25, 2015 @10:37AM (#9107186)
There's a variant of lodash with auto-currying and better argument ordering: https://github.com/lodash/lodash-fp

I haven't tried it, but it looks like it could basically replace Ramda (although I feel that Ramda might contain even more FP oriented functions).

Re:Higher-Order Functions in JavaScript by tobr on Wednesday February 25, 2015 @12:05PM (#9107852)
After a little bit of use, I feel like lodash-fp is limited by being a simple adaptation of lodash. Lodash's API is designed around variadic functions, which doesn't really work with autocurrying, so a bunch of important options and functionality is lost. On the other hand, working with Ramda makes me miss some of the flexibility of lodash - e.g., not having to use a different map() for arrays and objects.

The optimal functional utility library would be designed with autocurrying in mind from the start, but not shy away from flexibility where it makes sense.

Re:Higher-Order Functions in JavaScript by jdd on Thursday February 26, 2015 @08:38PM (#9116710)
Open an issue (https://github.com/lodash/lodash-fp/issues) for the options you'd like and we'll add alternative API to cover the arguments required.

lodash-fp does this for max, min, & uniq by offering maxBy, minBy, & uniqBy.

Re:Higher-Order Functions in JavaScript by k__ on Wednesday February 25, 2015 @10:52AM (#9107287)
I see. Nice :)

My library of choice is http://www.preludels.com

Re:Higher-Order Functions in JavaScript by klibertp on Wednesday February 25, 2015 @01:33PM (#9108537)
prelude-ls really shines when combined with LiveScript - syntactic support for partial application, currying, function composition, "pipelining" (|>), implicit arguments and so much more really make a difference.

I started writing a comparison between un-sugared JS and LS use for functional programming patterns, here: https://klibert.pl/warsawjs-talk/code.html (for the talk I gave: https://klibert.pl/warsawjs-talk/).

That being said, I'm very interested in mori, immutable-js or lz.js. prelude-ls is nice, but is designed to work with native JS types and provides no extended semantics that I'd find useful. It's still my go-to library when working on the frontend and it probably will remain one, but I'm thinking about contributing some support for other advanced collection types to it.