An Overview of the Monad
I always see monad tutorials like this conflate (1) &quot;understanding using particular monads&quot; with (2) &quot;understanding using monads in general&quot;, which are completely different things. Luckily it&#x27;s easy to not confuse those two with (3) &quot;understanding monads abstractly&quot; which tends to break out the category theory, but some tutorials like jumping on that too.<p>To demonstrate the differences, suppose now that you&#x27;re deep diving into a codebase which depends on a Async monad. Your eyes light up and you go aha(!) that means async programming, I&#x27;ve done that before! The point is, you saw &quot;Async&quot;, you know it means &quot;make some task&#x27;s outcome depend on a previous task&quot;, which is the behavior of bind for that particular monad. Without (1) the word &quot;monad&quot; is really unnecessary. Why not just refer to bind as some arbitrary async-API function? In summary, you don&#x27;t need (1), (2), or (3) for this! Monad is just a word.<p>Okay, when do we need (1)? Let&#x27;s say you&#x27;ve changed companies, and now you&#x27;re plugged into another codebase and oh(!) there&#x27;s that word &quot;monad&quot; again, but this time it&#x27;s the &quot;Future&quot; monad. Another whole API to learn... but soon you realize that it&#x27;s again the same old &quot;make some task&#x27;s outcome depend on a previous task&quot;. Except they just call it &quot;Future&quot;, and instead of &quot;bind&quot;, they say &quot;flatMap&quot; which is the same thing! And you bump into it again and again with different names -- Deferred, Aff, Task -- but in the end it&#x27;s the same behavior and API. How upsetting that they don&#x27;t call them all Async and be done with it! But if you have (1) you&#x27;ll know they are just the same monad, given different names. That&#x27;s (1): familiarity with the usage of a particular monad. Later on you might collect understanding of the Option&#x2F;Maybe&#x2F;Nullable monad, or the Result&#x2F;Either&#x2F;Error monad, or the List&#x2F;Stream&#x2F;Nondeterministic monad, so now names don&#x27;t bother you because you know CONCEPTS, but all of this is still (1) if each monad is being treated as an independent API to grok.<p>That&#x27;s where (2) comes in. Suppose now that you&#x27;re deep diving into a codebase which depends on the &quot;Anisotrope&quot; monad. You&#x27;ve never heard of this before[0], but you know monads in general i.e. (2), so you know you can make functions whose output (an Ansiotrope object) depends on some property of a Ansiotrope object, and that all the details about this dependency can be found in the definition of bind for this particular monad. In other words you can use knowledge of (2) to quickly adapt to new monads without having to regard them as a completely new concept. It lets you answer questions like &quot;what&#x27;s this Probability monad supposed to do? what about this Forkable monad?&quot; in a general way. Conversely, you can now start writing monads of your own by thinking about what bind could mean for your new &quot;Transmogrifying&quot; monad.<p>Is this useful? Imagine learning all OOP patterns knowing that every pattern is the same concept except for this one thing: bind. That means it&#x27;s relatively trivial to learn these patterns and make new ones. Except they&#x27;re not OOP patterns, it&#x27;s monads, and no, you can&#x27;t generalize OOP patterns the same way.<p>Anyways, this is also where &quot;monad is a box&quot;-esque metaphors fall short. It&#x27;s rather descriptive of particular monads, but doesn&#x27;t generalize well when you start reaching for many others: Reader(environment-passing), List(nondeterministic computations), Probability(probabilistic programming), or fun ones like parser monads, Amb(backtracking), Tardis(state-access-timeline-specifying)[1].<p>[0] I hope not, since I made it up. If you have (3) you&#x27;re probably deriving a working definition already. Have fun!
[1] <a href="http:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;tardis-0.4.1.0&#x2F;docs&#x2F;Control-Monad-Tardis.html" rel="nofollow">http:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;tardis-0.4.1.0&#x2F;docs&#x2F;Contr...</a>