4 ms·
I learned about Ramda reading Scott Sauyet's awesome presentation "Functional Programming using JavaScript" [1]. He does not focus on Ramda (or any library per
by felipesabino 12y ago
I learned about Ramda reading Scott Sauyet's awesome presentation "Functional Programming using JavaScript" [1].
He does not focus on Ramda (or any library per se), but he uses and explain several of it's functions to illustrate how simple it is to use functional programming concepts and achieve a code with much more quality and readability.
Definitely a must read for those adventuring in this world :)
[1] https://news.ycombinator.com/item?id=8652348 https://news.ycombinator.com/item?id=8652348
- acconrad 12y agoThe 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.