December 05, 2017 at 05:27 Tags Book reviews , Programming , Haskell

It's hard not to run into Graham Hutton's work when reading about functional programming, so reading a book on Haskell written by him sounded like a good opportunity to learn from a real expert. It turned out to be a good choice - this is definitely the best Haskell book I read so far.

The author's deep understanding of functional programming concepts and Haskell shines through the writing on many occasions. He carefully sets up explanations and examples that build one on top of another, and manages to explain some of the thorniest ideas of Haskell (applicatives and monads, I'm looking at you) very clearly; most importantly, the why of things is often explained, along with some important historical background that sheds some light on the design choices made by the language.

There's even space in this book for a few extended programming examples and exercises, both of which are very important for a programming book. Some of the exercises come with solutions in an appendix - a truly impressive information density for a ~250 page book.

My favorite chapter is Monadic Parsers; parser combinators is a very interesting topic, and I went through several resources that tried to explain it in Haskell. The treatment in this book is much better than anything I read before (it even inspired a blog post to document my understanding).

On the flip side, the last two chapters - on automatically proving programs correct, as well as deriving correct programs from definitions - were puzzling. Felt too academic and somewhat out of place in a book teaching a programming language. I suppose that when you write a book, it's your prerogative to include some of the research topics you're excited about and pitch them to a more general audience :-)

It's hard to resist comparing this book to Learn You a Haskell (LYAH), which is based on the false premise that complete beginners want or need to learn Haskell (IMHO they don't). I would guess that most folks coming to Haskell have some programming experience in other languages and are looking to expand their horizons and get some functional and static typing enlightment. Programming in Haskell is exactly the book these programmers need to read.