When programmers hear about functional programming, they usually associate it with such stalwarts as Lisp and Scheme. Lisp has been with us for about half a century--computer science (CS) is not such a young field anymore--and many among us, at some point or another, maybe during college or when grappling with the Emacs editor, have come to learn it and love it, or detest it. Indeed, the success of Lisp sometimes blinds us to the fact that there is much more to functional programming than closing brackets; other functional programming languages have been developed and used for education, research, and practice.
Haskell is a functional programming language, particularly popular for teaching functional programming in the UK, but which has also found some application in research settings. It has much to recommend it, and approaching it for the first time can be a moment of revelation, especially if you have only been involved in procedural or object-oriented (OO) programming.
Hutton’s book is a slim volume describing the language. Its length--less than 160 pages, not counting the appendices--is a great asset. This is a dense book that will require close attention from the reader, but it is a rewarding book, in that the reader who persists will enjoy many “a-ha!” moments.
Nowadays, most programming books guide the reader closely in the learning process, by giving exact instructions on terminal input and screen output. Hutton does provide a brief introduction to the Haskell environment (called Hugs), but prefers rigor to gentle handholding; for instance, the example code is written to be read, not to be typed. So, the readers will see lambda expressions written with &lgr;, and unless they already know, they will have to turn to an appendix to see how this is typed (answer: \). It is clear that Hutton prefers to focus on principles. Because functional programming is pretty much about principles, I appreciate this route.
The book starts with the bare fundamentals, and then builds on top of them. The first interesting stand-alone program, an implementation of the Caesar cipher, comes a third of the way into the book. Up to that point, we have already encountered many elegant code snippets that illustrate the power of the Haskell functional programming paradigm.
Although brevity is a virtue of this book, there are points that would merit a more extended discussion. For example, the presentation of curried functions is about a page long, although currying is a key concept in Haskell. Such brevity does not convey the important fact that currying is used everywhere in Haskell; this will dawn on the reader later on, while reading subsequent chapters, or the reader may have to search online for better understanding.
Recursion and higher-order functions--that is, functions that take a function as an argument or return a function as a result--are given more space: a chapter each. Separate chapters treat parsers, interactive programs, types and classes, and lazy evaluation. The book closes with a brief introduction to reasoning about programs. As the book progresses, so does the size of the examples, allowing readers to see how the language can be used for more involved applications.
Even if you are already using Haskell in your everyday programming, it is still worth devoting some time to learn more about it; you will also learn more about other, more popular languages. After reading, for instance, about list comprehension in Haskell, list comprehension in Python seems like a natural offshoot. This is a book for programmers wanting a serious introduction to an important subject.