Re:Ramda – A practical functional library for Javascript
by d0m on Friday November 28, 2014 @09:49PM
(#8672915)
The big difference is to have everything curried by default, and also having the list/object coming as the last argument. But then, I know there seems to have a lot of function, but for the file size, it just gets really handy when you need just this. I.e. You can build your own groupBy with reduce, but having a builtin one is really useful.
Re:Ramda – A practical functional library for Javascript
by acjohnson55 on Saturday November 29, 2014 @10:01AM
(#8673857)
Well, if you want to be really minimal, `reduce` obviates the need for `map`, `filter`, and `forEach`. (Then I guess if you want to be all new school with it, you could use tranducers, but that's another story.) What I don't get is why Javascript libraries are so `flatMap` averse. Sure, it's a little harder to explain, but especially with the Promise-like convention, I think it's a quite generalization of `map` in most cases.
Re:Ramda – A practical functional library for Javascript
by buzzdecafe on Saturday November 29, 2014 @07:47AM
(#8673645)
(ramda co-author here) I agree the api has gotten a bit, let's say "broad". we're working on modularizing the lib now, and we plan to provide different builds as well as a facility to roll your own.
http://scott.sauyet.com/Javascript/Talk/2014/01/FuncProgTalk...
You can boil down FP on JS to 5 fundamental functions:
* map
* reduce
* filter
* compose
* curry
* forEach (maybe)
the first 3 and last 1 are already available to you on arrays. Compose is a pretty simple polyfill as is curry, I'm not sure if you really need an entire library to add this in for you.