3 ms·
Monads aren't that hard. A monad is just like a burrito! Pattern matching is awesome. It makes code immensely more readable.
by time_management 18y ago
Monads aren't that hard. A monad is just like a burrito!
Pattern matching is awesome. It makes code immensely more readable.
- silentbicycle 18y agoI started to understand monads when I compared the Maybe monad to the short-circuiting behavior of the Unix pipe. That doesn't mean my insight will work for anybody else, though. Also, having masses of Haskell blog posts saying, "No, monads are actually not that hard, here's (an explanation that probably won't actually make all that much sense)." probably doesn't help to dispel the myth that Haskell is hard / impractical / whatever.
- time_management 18y agoIn understanding monads, I think Maybe and List are the best places to start, because they're familiar data structures. IO is conceptually familiar, but IO as an immutable value representing a series of actions is not.
- silentbicycle 18y agoAgreed, strongly. Trying to understand monads in terms of IO makes things vastly more difficult than necessary.
- time_management 18y agoWell, just as "monads are like burritos", IO is like a delicious but sketchy fish taco. Eating is input. We shan't discuss the output process; we all know how it works and what it looks like. Food poisoning or poor health can lead to usage of standard error. In practice, stdout and stderr are usually redirected to the same buffer, which is flushed shortly after a write.
- ighost 18y agobrilliant.