Re:What I Wish I Knew When Learning Haskell
by chowells on Saturday December 07, 2013 @10:13PM
(#6868813)
Monads are number 1 from that list.
Numbers 2, 3, and 4 are the result of a powerful static type system, purity, and having typed IO. Nothing you listed has anything to do with being a monad. They're just examples of things you can do with types.
Your numbers 5 and 6 are sort of accurate. It's true that you can say "Hey, I think this type might form a monad," and explore from there. But if it does, it's nothing greatly interesting - you just get to take advantage of a bunch of existing library code. (And a little syntactic sugar, in Haskell.)
Re:What I Wish I Knew When Learning Haskell
by mightybyte on Sunday December 08, 2013 @02:43AM
(#6869245)
Right, my presentation is clear that it's not just monads, but rather the interaction of purity, strong types, and monads that gets us those benefits. I list them when people ask about monads because, while they might not be what monads are actually about, they were big things that Haskell gained with the introduction of monads. So I think they're an important part of the explanation that we give to Haskell newcomers.
http://vimeo.com/59215336
The presentation is built around two real examples of software engineering problems that I encountered in my career. One encountered in a Java project, and one in a Haskell project. The thesis of the presentation is that monads are much more useful when combined with Haskell's strong static type system and purity. This also suggest a pretty good explanation of why pg doesn't talk about them--he's more of a dynamic language guy.
Here are a few of the concluding bullet points from the presentation.
Monads can:
3. Help you prevent data corruption in concurrent applications in pursuit of shorter critical sections and reduced lock contenion.
4. Prevent bugs that might arise from confusion between different phases of execution.
5. Guide exploration of complicated problems
6. Expand your dictionary of concepts and ways of thinking about a problem.