In functional programming, at the heart of input/output, optionality, state, logic, and much more lies an extraordinarily powerful abstraction called a monad. Although monads are key to unlocking the practical power of functional programming, many developers find them confusing and esoteric, and struggle with functional programming because they do not understand or see the applications of monads.
Now acclaimed speaker, functional programmer, and author Alejandro Serrano Mena has tackled the subject of monads in the world's first accessible, methodical, and encyclopedic book on the subject, written from the perspective of real-world programming. Serrano Mena's work goes beyond definitions and laws to ensure readers master not just the concept of monads, but all the ways different monads can be used to solve everyday problems.
Developers from many different backgrounds can follow along with code examples in Haskell and Scala (and some in F#, Idris, and C#), and a focus on simple examples. The book contains exercises that train developers to develop practical skills, and a thorough explanation of adjacent concepts, including functors, applicative functors, monad transformers, final tagless, free monads, extensible effects, and the origins of monads in category theory.
This book is a required one if you want to write in any statically typed FP language. It covers the practical part, not only theory which is useless by itself. Thanks a lot!
Wow, this is an epic book. So you wanted to get the hang of monads and picked up this book? Well, now you have way more information that you expected. Yes, a lot of information, including more advanced stuff like free and freer monads; I was mostly lost in the second half because I didn't spend much time to go through the examples and exercises, whereas the first half was mostly familiar. I consider this a first reading to get an overview of the topic and will probably reread it soon, when I get into Haskell deeper. What's great about the style is that the majority of (all?) concepts are introduced naturally, step by step, not just all of a sudden, for example `Traversable`s, monad laws with Kliesli arrows and contravariant functors. You do need to know some Haskell to understand the code.
So far almost done with it, but It's a good starting point to get how you can interact and work with monads (I still have no idea what a monad is a mystery to never be solved I guess), knowing how to use Haskell is a plus for understanding snippets and examples, nevertheless good to know your functional tool set better.
After growing increasingly disillusioned with the online and book literature on Monads, I turned to this book with the hope of finding a more coherent and precise exploration of the topic. The challenge lies in the ambiguity surrounding the approach to discussing Monads, with some sources delving into esoteric and convoluted explanations ("A monad is just a monoid in the category of endofunctors"), while others merely scratch the surface with trivial insights ("reimplement the Maybe Monad").
In an effort to avoid replicating the shortcomings of the book in question, I'll be specific in my critique:
[x] Severely lacks readability and engagement: The writing style of this book is drier than a bull's udder. Page after page of dense text becomes incomprehensible shortly after starting a new chapter. [x] Lacks practical application and hands-on learning: The author omits much of the actual code, relegating it to exercises for the reader without providing solutions. [x] Shortage of engaging and relevant exercises: "Exercise 13.10: Trace the execution of fmap f (Free (Info p k)) using the same style as above."
At the end, the only thing the reader is convinced of is that the author spent a lot of time collecting material for the book rather than ensuring an engaging learning experience. I've been trying to finish the book for more than a year with difficulty staying engaged for more than a couple of weeks.