Thinking Functionally with Haskell: Bird, Richard: 9781107087200: Amazon.com: Books

3 min read Original article ↗

This is a very solid introductory textbook on both functional programming and Haskell as a language, and probably among the better ones on either topic -- with the caveat that I haven't read through everything that's on the market, including Bird's own prior textbooks.

The text reads smoothly, and is far less dry than Hutton's. This is not necessarily something you're looking for in a textbook, but I found this to be a pleasant departure from the common practice.

The approach taken here is heavy on equational reasoning, and the author is not afraid to delve into topics often perceived as arcane -- such as performance optimization of Haskell programs. The book does shy away from discussing rigorous methods for establishing asymptotic complexity under lazy evaluation, but that's probably a good thing in an introductory textbook, and you'd want to refer to Okasaki's PFDS or somesuch for the gory details anyway. Overall, the book takes more of a computer science-y approach, which I find to be slightly preferrable to the alternative "let's start hacking and think about getting out of the mess later" route, though some clever combination of the two might be superior to either.

Another win is that the fairly elaborate exercises come with full solutions by the author, printed at the end of each chapter. This makes Thinking Functionally superbly suited for self-study, but probably makes it less appropriate as a basis for a course at a brick-and-mortar school.

The book seems to expect a certain degree of mathematical maturity, and may be moving too fast for people without a couple of years of CS, math, EE or similar experience under their belt.

I have fairly lukewarm feelings about the book's occasional tendency to borrow features from the future without explaining those, but this doesn't seem like an oversight on the author's part, and more of a principled approach along the lines of "you don't need to understand the details right now, we'll get there eventually, but for now just trust me." I cannot attest whether this works for the target audience or not, as I was fairly familiar with most of the material covered already.

Lastly -- and this something of a pet peeve of mine -- I really rather hate the idea of discussing folds without even mentioning unfolds, but oh well. Let's face it, that's all too common anyway, and people live with it somehow. This is just about the only point where Hutton's book does win over Thinking Functionally.