Learn Haskell in Three Weekends

Posted on January 24, 2014

I recently started learning Haskell and thought I’d document the journey.

Weekend One

Read Learn You a Haskell for Great Good (LYAH). It’s by far the most accessible introduction I’ve found and is a (relatively) easy and fast read.

Weekend Two

Reading two different books on the same subject is a great way for me to reinforce understanding. To that end, I looked at a few chapters from the Haskell wikibook on the topics I had a trickier time with. Mostly the usual suspects: functors, applicatives and monads.

It was also time to get my hands dirty! Solving the first 10 or so problems on Project Euler really solidified a lot of the concepts. Computing the Fibonacci sequence was especially instructive for how laziness works in Haskell and how laziness can avoid explicit memoization. Some people even call Fibonacci the hello world of Haskell.

Weekend Three

Time for some actual production code. Following advice from Stack Overflow, I took a look at the source code for XMonad, a window manager written in a mere 2000 LINES OF HASKELL CODE (comments and headers included!). There’s even a guided tour of the code!