It's not about "programming cleverness" - there's nothing "clever" about monads, rather the monad is a very simple and boring interface that turns out to be a good tool for helping you write code that does what it looks like.
It's not about "programming cleverness" - there's nothing "clever" about monads, rather the monad is a very simple and boring interface that turns out to be a good tool for helping you write code that does what it looks like.
Take the Linux kernel, NASA rovers, or redis - all written in boring old C with no monads and great results.
The only one that comes to mind is Spark, and while I haven't used it recently, was nightmarishly buggy with many subtle corner cases :/
Even jumping outside of C, Atom, Eclipse, Chrome, FireFox all are maintained by large groups of people and dont have a single monad!
NASA's projects that do hit this standard tend to be written in CL with macros that do this.
I haven't read redis; anyone else?
The sheer number of committers guarantees bugs. That is not a remarkable feature. The remarkable number of committers is.
Perhaps another metric is how long after your code is released will you be able to support it? In which case Linux and NASA do quite well.
This is a good read: http://web.cecs.pdx.edu/~antoy/Courses/TPFLP/lectures/MONADS...
A monad is basically an function, in the algebra sense, that will take a set of input, and map it to a different output.
That's the most simple definition I can give without getting into the math, and it's been a minute since I've really gotten into Group theory.
Maybe through a Haskell tutorial for some hands-on guidance?
http://m50d.github.io/2013/01/16/generic-contexts is an explanation of a case where I found myself using the Applicative interface - Monad is very similar to Applicative (it just adds one extra possible operation).
That turns out to be extremely useful in many cases.
Even so, I don't believe that monads are the only way to write good code.
In short they are way to automate building new types out of old types in such a way that code written for the old types can immediately be turned into code written for the new types. This allows a lot of otherwise repetitive code that you might otherwise wind up writing to be pushed to your type system. Which in turn makes it feasible to build a richer type system.
Haskell takes this idea to an extreme.