| Here's my take on a monad tutorial: https://lobste.rs/s/7cllte/monads_part_six_really_what_is_mo... TL;DR: Monads are Promises and async/await, but generalized to different implementations of `.then`. You are right to be suspicious; it is _not_ that hard! I think people just get confused and overwhelmed because (1) there are many separate different concepts that are all being introduced at once, and (2) you need to learn a new debugging methodology at the same time. I think the vast majority of this problem is the huge deluge of bad teaching materials (especially monad tutorials written by people who do not use Haskell in production) and the shortage of good teaching materials. Re: 1 - some separate, orthogonal concepts that I have seen people mix up while trying to teach Haskell: 1. Effect tracking (which is a thing that we _do_ using monads, but is not intrinsically tied to monads - this would be better served by being taught as "dependency injection but stricter") 2. Non-eager evaluation (which is a language runtime evaluation choice that Haskell has made, and which motivates the usage of monads where most languages have function bodies, but is again not intrinsically tied to monads) 3. "Purity" (a more confusing way to explain 1) 4. "Mutable state" (another thing we represent with monads, but again is not intrinsic to monads) 5. Monads the math / category theory concept (don't bother with teaching this - it will not be helpful until you have intuition for writing and operating the programs themselves first, which takes at least a few months to build, and even then it is mostly useful as a source of advanced techniques for library writers rather than application writers) At work, we've developed our own set of educational materials for teaching folks the language. I'm working on externalizing them in my spare time. |