April 27, 2018

Learning to program in Haskell

Far and away, "learn you a Haskell" is the best resource to learn Haskell. It has certainly served me well. I spent a lot of time with the online pages, and then purchased a printed copy, which is absolutely worth doing. Don't be fooled by the authors sense of humor, he knows his Haskell and knows how to explain things. This book is the best resource there is, hands down.

I just ordered a copy of "the craft of FP". This is in a third edition (circa 2011). I found an inexpensive used copy of the second edition (1999). My advice is simple -- forget it. The book "learn you a Haskell" is so much better that it is really impossible to find any reason to recommend this. If you are a student, the gun is to your head and you have to buy it -- and in the latest edition mind you. If you are new to programming and having trouble with "Learn you a Haskell" maybe you could consider this book as a stepping stone. I thought briefly that the fact that this book is getting revisions as a hopeful sign, but given that this is used as a university textbook and revising those is part of the textbook racket, that tells us nothing. I would not rush out and buy this book, "learn you a Haskell" is a much better choice.

Real World Haskell is a bad book! This is not to say you should not buy and study it, but realize that this is like buying a car with a broken transmission with the understanding that you are going to learn a lot repairing it. See my notes for help.

No doubt some people will be put off by the humor and offbeat artwork in "learn you a Haskell". I find them to be part of the charm of the book, which is entirely serious in its presentation of the language and concepts. My only complaint is that there is no "hello world" example in the first or second chapter.

the Haskell standard Prelude

Studying the prelude is a great way to learn things and answer a lot of questions. The prelude is chapter 8 in the Haskell 98 report, which is something else you should study if you are at all serious about learning Haskell. If you are going to dive into that, you may get ideas about looking at the source for GHC: So I did as recommended and cloned as follows:
git clone --recursive git://git.haskell.org/ghc.git

Online Resources

Aside from these printed books, there are lots of interesting online tutorials; I provide links to a few that look good. Actually there are no end of online resources for learning Haskell, the trick is picking the good ones if you are going to invest your time.

I give special kudos to the "fast and hard" tutorial because it begin (like every tutorial should) with a one line "hello world" example.
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org