3 ms·
I've used this guide as a reference and now feel pretty good with a lot of FP concepts and why they exist - pure functions, monads vs applicative vs functors, r
by bern4444 4y ago
I've used this guide as a reference and now feel pretty good with a lot of FP concepts and why they exist - pure functions, monads vs applicative vs functors, referential transparency etc
It's easy to understand Lists, Options, Eithers and all the other classic monads and what they do. It's harder to understand other forms this can take.
At work I had to build something that ended up leading to creating a new monad type[0]. That process crystalized why we ended up with these ideas and structures much more clearly.
I also highly recommend any of Scott Wlaschin's videos[1]. He does a great job conveying FP ideas, and his videos introduced me to F# which is a really fun language with a very clean syntax.
Another great blog is by James Sinclair [2] who similarly has several articles on using FP in a practical way though some of the code can get a little deep but in an interesting way.
Loosely coupled but cohesive is a very useful mantra when integrating FP ideas along with keeping everything very simple - avoid crazy compositions, deeply nested types, etc. Just cause something can be abstracted due to FP (composing a bunch of function calls, looping once instead of 3 times etc) doesn't mean you should. There is value in breaking pieces up.
[0] https://sambernheim.com/blog/building-a-monad https://sambernheim.com/blog/building-a-monad
[1] https://www.google.com/search?client=safari&rls=en&q=scott+wlaschin+fp&ie=UTF-8&oe=UTF-8 https://www.google.com/search?client=safari&rls=en&q=scott+w...
[2] https://jrsinclair.com/web-development/ https://jrsinclair.com/web-development/