I like the "do" notation in Haskell because it boils down the meaning of monads to the following:
Monads let you break the functional programming paradigm that a function should have the same value each time it is called. e.g.
do {
x <- getInput
y <- getInput
return x+y }
here getInput is called two times and each time it has a different value. When you now think about how this can happen in a functional language you have to understand what a monad does.
The heureka moment came when I learned about the flatMap in scala which is nothing else but the bind function in haskell ("just flatmap that sXXt") and voila thats how to use monads.
Monads let you break the functional programming paradigm that a function should have the same value each time it is called. e.g.
here getInput is called two times and each time it has a different value. When you now think about how this can happen in a functional language you have to understand what a monad does.The heureka moment came when I learned about the flatMap in scala which is nothing else but the bind function in haskell ("just flatmap that sXXt") and voila thats how to use monads.
See the following explanation:
https://medium.com/free-code-camp/demystifying-the-monad-in-...