3 ms·
The examples he goes through are awesome, but I feel that this framework is a bit bloated. As he says in slide 135: http://scott.sauyet.com/Javascript/Talk/201
by acconrad 12y ago
The examples he goes through are awesome, but I feel that this framework is a bit bloated. As he says in slide 135:
http://scott.sauyet.com/Javascript/Talk/2014/01/FuncProgTalk/#slide-135 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.
- d0m 12y agoThe 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.
- buzzdecafe 12y ago(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.
- acjohnson55 12y agoWell, 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.