3 ms·
The way to learn monads is to just avoid them while hacking Haskell (or another functional language) and find the boilerplate of handling things like state or e
by exdsq 5y ago
The way to learn monads is to just avoid them while hacking Haskell (or another functional language) and find the boilerplate of handling things like state or errors annoying. I truly don't believe any other way is as effective.
- neilparikh 5y agoPut another way, use each monad instance on its own, and ignore that it's a monad in the first place (ie. use the IO monad, but pretend the syntax is IO specific, use the List monad, but pretend the syntax is List specific etc.) After you do enough of these, you'll start to see the common pattern, and wish there was a way to abstract over them. Surprise: there is! This is basically I assume monads were developed as well.
- acjohnson55 5y agoThis is the approach of the popular book Functional Programming in Scala.
- deleted 5y ago[deleted]