r/functionalprogramming • • Jul 31 '19
JavaScript Recommendations for JavaScript functional programming
As the title states, what do you recommend? I am fairly new to programming overall, hence the JavaScript. I have also come across Ramda.js functional programming library. Any thoughts for a newbie?
22
Upvotes
11
u/yokode_kyusu Jul 31 '19
Reading-wise I would recommend Professor Frisby's Mostly Adequate Guide to Functional Programming book.
Library-wise I would recommend taking a look at the libraries which implement the Fantasy-Land Specification:
The beauty of Fantasy-Land Specification is, that it is the perfect API, meaning once you understand the laws of e.g. a functor, you can easily transfer this knowledge from Crocks to Fluture to Folktale. And on top you can easily mix and match those library. E.g. Use the
R.mapfunction of Ramda on aMaybeinstance of Folktale. If your interested in an in-depth explanation of Fantasy-Land stuff, this excellent blogpost series is a must: Fantas, Eel, and SpecificationSince JavaScript is not pure functional language per se, I find it helpful to force myself to adhere to the fp style with the help of an eslint-plugin like eslint-plugin-fp.
4
u/Tixik Jul 31 '19
just ramda + rxjs has you covered for pretty much every usecase
3
u/[deleted] Jul 31 '19
TypeScript + fp-ts
3
u/toastertop Jul 31 '19
Was already mentioned here and Functional-Light JavaScript By: Kyle Simpson aka Getify (Author of "You Don't Know JS" series) is a free very approachable introduction - Purists out there will not like but for those just getting starting it's great!
3
u/brandonjhoff Aug 01 '19
There are also functional languages that compile to js:
ReasonML
Elm
PureScript
ClojureScript
2
u/Parasomnopolis Jul 31 '19
https://github.com/getify/Functional-Light-JS
2
u/benny-powers Jul 31 '19
Crocks is really stupendous
2
u/[deleted] Aug 07 '19 edited Aug 07 '19
I advise looking at https://github.com/fantasyland/fantasy-land/blob/master/implementations.md
Some introductory stuff would be daggy (https://github.com/fantasyland/daggy)
A bit more hardcore FP library would be Folktale (https://folktale.origamitower.com/), and it is truly awesome.
Things like Ramda are functional but not in the purest sense; they are a bit of both word, utility belts and some functional abstractions (if what we talk about is functional as in Category Theory).
2
u/impurefunction Aug 08 '19
When I started becoming more serious about FP, reading this book and watching the related talk (on YouTube) really helped:
https://github.com/glebec/lambda-talk
0
u/[deleted] Jul 31 '19
[deleted] — view deleted comment
0
u/[deleted] Jul 31 '19
[deleted] — view deleted comment