Haskell books

Posted on January 3, 2014 by rkrishnan

There are lots of books on the programming language, Haskell, which, the folklore say, has a steep learning curve. I am no Haskell expert, having embarked on the journey to learn Haskell myself two years ago and still very much learning. A friend of mine recently asked me for recommendations on Haskell books, which inspired me to write this post. Again, I am no Haskell expert, still very much a journeyman Haskeller.

Usually two books get recommended by almost everyone. Those two books are

There is no question that these two are great books. I have paper copies of both the books and still use them. I think everyone aspiring to learn Haskell should read these books, especially RWH. LYAH is similar to the Haskell Tutorial or YAHT, only a bit more verbose with funny pictures. It is a nice introductory book.

There are some other books that I like along with the above ones. One of the thing I look, in any programming book that I intend to buy (investing my money) and read (investing my time, because I am serious about learning the material) is that they contain exercises. I feel that testing one’s knowledge of understanding is extremely important and good exercises of varied difficulty (good books indicate the level of difficulty of exercise problems) is very important, as far as I am concerned. The other thing is that I like less verbose books – like the K&R C, SICP, TSPL etc.

So, with that in mind, here are my recommended books on Haskell:

Actually I read the previous edition of this book co-authored by Phil Wadler but that book had its examples in Haskell’s pre-cursor language, Miranda. I think just about every programmer should read this wonderful book for the clarity of presentation.

Hutton’s book is probably what one should read (and work through) to get deep into Haskell. It has some great exercises as well. Some people compare this book to K&R C book. For those experienced in other Functional programming languages, this is a great book.

If you are into maths, then Haskell is the closest thing to Maths that you can get in the programming world. “Haskell Road to Logic” is a great book on Set theory, inductive proofs etc using Haskell.

Writing real world programs

I found myself staring at my editor sometimes with just the below lines on it:

main = 

The problem is that most of these books teach the purely functional part of Haskell beautifully well. While that is very important and requires a different mindset, especially if one has a prolonged exposure to imperative programming, it can only help to get the room warm by heating up the CPU. One need to interact with the real world to do some stuff in and out. It is extremely easy to do I/O in Haskell. Just start using it without worrying about Monads.

And that brings me to the next topic:

Do not learn monads by analogies. Do not read any Monad tutorials which compares Monads with anything else. Just start using it. Take some time to learn the type signature of Monads and start building programs with them.

If you really want to read a monad tutorial, I highly recommend these two papers.

If you are allowed to read just one blog post on the subject, I would suggest reading Chris Taylor’s post on IO Monad. Be sure to read it after reading Wadler’s and SPJ’s papers.

This is where RWH comes into picture. It has a number of great examples and is written by programmers who have contributed tons of great code to the Haskell community.

Algorithms

Traditional algorithm books describe algorithms in imperative style. Two great books exist in the Haskell world that beautifully describe algorithms.

Other misc resources

Another great resource is Don Stewart’s StackOverflow answers on Haskell and the #haskell freenode irc channel. I am not big into irc. I join the channel occasionally, it is one of the most friendly places to hangout with other Haskell programmers.

Also highly recommended is the Haskell wikibook.

Happy Haskell Hacking!