3 ms·
it's a mathematical concept that can be applied to many things including programming. It's a construct in Category Theory that when *applied* to programming bec
by proc0 4y ago
it's a mathematical concept that can be applied to many things including programming. It's a construct in Category Theory that when *applied* to programming becomes a way to chain computations together that depend on some computational context.
In a practical sense, a Monad is an abstract interface that once implemented defines its own chaining and execution behavior. It can be implemented several ways, but the main idea is that it chains computations inside of their context. There is more to be said about why it's useful and all that, but in summary it became useful in mathematical style programming languages.
The reason Monads are confusing is because there is no distinction between the mathematical concept (which requires CT foundation to understand), and the implementation in programming which was derived from CT. That said, there is no usefulness to a Monad, without the underlying mathematical understanding, at least in my opinion, because the whole point of it is to use it with other CT concepts to create a robust program that is leveraging mathematical laws.