Earlier quoted context omitted.
> You need a Monad type in order to express that certain things are supposed to happen after other things This is the kind of explanation that drives me absolutely batshit crazy because it is fundamentally at odds with: > Do you understand "flatmap"? Good, that's literally all a monad is: a flatmappable. So, I think I understand flatmap, assuming that this is what you mean: https://www.w3schools.com/Jsref/jsref_array…
Because you're not used to abstract algebra. JavaScript arrays form a monad with flatmap as the join operator. There are multiple ways to make a monad with list like structures. And you are correct. Monads have nothing to do with sequencing (I mean any more than any other non commutative operator -- remember x^2 is not the same as 2^x) Haskell handles sequencing by reducing to weak head normal form which is controlle…
a.M(b).M(c) = a.M(function(x){return b(x).M(c)})
So the next question is: why should I care about that pattern in particular?