|
|
|
Ask HN: Does anyone know what a monad is?
|
|
3 points
by etrvic
35 days ago
|
|
I’ve started learning haskell a few weeks ago and I’ve been recently trying to understand what a monad is. I can’t seem to find and explanation that makes sense. Every other comment on the subject seems to be about how no one can explain what is a monad. For example I don’t understand (beyond the concept as a whole):
1. How do monads allow side effects if you can’t have side effects in Haskell?
2. Are monads just a name for a reccuring way to aproach a problem?
3. In what scenario would you use a monad, or for what type of problem? |
|
"Functor", "Applicative", and "Monad" are all just generalizations of the concept of `map` and `flatMap`.
There's nothing really more complex to it, besides how you squint at various things (like functions) to fit them into the concept of `map` and `flatMap`.To answer your questions more directly: