3 ms·
It is about state not necessarily mutable state. Monads are rather abstract and not really worth all the attention they get. A monad is simply: a type construc
by stonemetal 17y ago
It is about state not necessarily mutable state. Monads are rather abstract and not really worth all the attention they get. A monad is simply: a type constructor, a function that puts a value into the type constructor, and a function that pulls the value from the type constructor and pass it on to the next function(often referred to as return and bind respectively). Then depending on how you define the type constructor and functions to push and pull you get different Monads. Monads are no different than Objects or design patterns, they are a code organization technique that happens to fit functional programming well.