What are the hard parts of Haskell, and how long would it take for a normal person to get it?

I haven't started to read about Monads yet, but I've heard that's one of the hard things about it.

The hardest thing about monads when I learned them was getting past the jargon, mysticism and the misunderstandings those led me to. For quite a while I thought I had grokked them, but I'd only really understood one way that some types use the Monad interface (what IO, ST and State have in common) and that meant I got into trouble with e.g. Maybe until I sat down and worked it through and realized I was missing the simple and obvious by blocking it out with a false mental model.

Basically, the concepts really aren't hard, but they may be unfamiliar and they almost certainly come packaged in unfamiliar terminology (and if you chose poorly, also misleading metaphors) so if my experience is anything to judge by, it's partly learning from the right sources, partly bouncing the ideas around (and testing your beliefs by writing your own test examples and diagnosing the issues instead of - or at least as well as - swearing at the type-checker.

Good sources include...

  • Tackling the Awkward Squad - with an I-got-too-hung-up-on-IO caveat.

  • All About Monads - caveat here is when I first read this, I must have skimmed, misunderstood, dismissed and quickly forgot the little I did get from it - I only relatively recently came back to it, already knowing most (but not all) of what it explains. If only I'd read it properly from the start!

  • Monads and All That - link is to first part of a one-hour-plus lecture, which is the first of a four-lecture series (monads, monad transformers, applicatives, quickcheck) and is awesome.

/r/haskell Thread