Re:Haskell Concepts in One Sentence
by dack on Sunday March 26, 2017 @10:30AM
(#13960939)
It lets you model sequential operation and side effects in a pure functional language. You can usually write your code "manually" without monads, and see what it's like. For example, the State monad is basically a function that takes in a value and some state, and returns a new value and a new state. That's a pure function, but composing/chaining them together is pretty messy. If you do that manually once, you'll then get some intuition why the State monad is useful. Then you can expand to other types of monads and eventually have an intuition for their general value.
[ Parent
| on HN ]
There are no comments on this comment yet.