3 ms·
Monad is a mathematical term for certain forms of (categorical) abstraction. Yes, Haskell actively uses the term "monad" in the language itself to discuss these
by WorldMaker 10y ago
Monad is a mathematical term for certain forms of (categorical) abstraction. Yes, Haskell actively uses the term "monad" in the language itself to discuss these things, but that doesn't make them a "Haskell thing" any more than Fortran has mathematical formulas and thus all math is a "Fortran thing".
Monads are also not a "workaround for certain problems", contrary to what you hear sometimes, but an attempt to generalize a number of seemingly unrelated concepts into a uniform interface.
Uniform interfaces are good for programmers. This is the magic that monads bring to other languages as we get a handle of what the monad is for and what it does. You don't have to know what a monad is to make use of it. You don't need to know that Promises are a "continuation monad" to take advantage of the fact that async/await are simple tools to transform the "continuation monad" into something resembling synchronous code, which is a big win.
(Meanwhile Haskell points out that you can go simpler than async/await for your monad bindings if you like and use the same constructs for other monads too, but language developers are taking this one step at a time and trying to hit a happy medium where they have the power that monad binding gives but the discoverability and debuggability of more bespoke solutions to individual monads...)
Needless to say, it's not cargo culting so much as learning more about the very mathematical fundamentals of programming and using those fundamentals to build better languages with better features for better programs.