5 ms·
It's not hard to describe what monads are, but it's probably not going to convince anyone of its importance without an appropriate language. The monad per se is
by juxtapose 5y ago
It's not hard to describe what monads are, but it's probably not going to convince anyone of its importance without an appropriate language. The monad per se is an extremely simple idea. In fact, monadic interfaces are ubiquitous:
Rust: Result::and_then()
Scala: Option.flatMap()
JS: Promise.then()
...
I agree it can take some time to discover the similarities between these interfaces. But a monad is just that. It's so simple that we are blind to see.
Unfortunately, it requires a sufficiently advanced language to express the concept of Monad. You need at least higher-kinded types and means to describe behaviors of HKTs.
Can you understand or describe monads in a less powerful language, say Rust? Definitely!
But will you appreciate the power that monads give you in Rust? Probably no.