Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Haskell : the craft of functional programming (3rd ed.)
Thompson S., Addison-Wesley Publishing Company, Harlow, UK, 2011. 528 pp. Type: Book (978-0-201882-95-7)
Date Reviewed: May 11 2012

Functional programming--a fertile area of computer science research admired for its mathematical elegance--has become practical for software development thanks to ever-growing advances in hardware and in compiler design. Not surprisingly, there is also increasing interest in introducing it into the curriculum earlier rather than later, and teaching a functional language as the first programming language is not out of the question anymore. This is an excellent book for the classroom and for self-study. The third edition brings the text up to speed with Haskell 2010 and incorporates several changes and improvements, many based on classroom experience. It uses the Haskell Platform (GHC and GHCi)--previous editions used the Hugs interactive environment.

I very much like Thompson’s top-down approach to teaching Haskell, a powerful and beautiful but undeniably complex language. Conceptual material is introduced early in the book and revisited later--often more than once--as additional details are uncovered. Readers are actively involved from the very beginning where they can manipulate pictures and see the results in a browser window. Although most of the magic involved is hidden from the readers at this point, they can clearly understand what they are learning and can immediately see the results of their actions. As the reader proceeds, more and more of the magic becomes evident. Throughout, the author and the reader engage in a very effective continuous interaction.

Thompson’s explanations are extremely clear. Sample code is abundant, and so are exercises. Indeed, the exercises constitute an integral part of the book; they are interesting and instructive. Most are straightforward, some are hard, some are very hard, and some are almost certainly too difficult without assistance. But given the synergistic combination of text, examples, and exercises, readers have plenty of opportunities to build up their grasp of the material and confidence in using it correctly. It is not hard to come up with variations on the themes presented in the book, something that Thompson encourages in the exercises. If at first some examples seem overly simplistic, the exercises certainly are not (even at the beginning of the book). As the book proceeds, the pace picks up, and particularly in the latter chapters the material is presented only schematically--but fully developed--in the exercises. The result: readers will have to put in a significant amount of work in order to fully benefit from the book.

When introducing a programming language, it is tempting to explain the basics in detail and in the process duplicate large parts of the functionality already present in existing libraries. Thompson takes a different approach: primarily, he explains and illustrates the features available in standard Prelude and in other libraries that are part of the Haskell language; however, to allow for a fuller understanding, he also selectively shows how some of those features are or can be implemented. The result is interesting and effective.

For testing, Thompson uses QuickCheck (extensively) and HUnit (to a lesser extent). A few examples of their use are shown; mostly, though, Thompson gives a few hints and leaves the work to the reader in the exercises.

The table of contents is available on the book’s Web site (http://www.haskellcraft.com/craft3e/Home.html). The source code can be downloaded as well. Instructors can obtain a solutions manual from the publisher.

I have a few minor complaints:

  • Because of the text’s font, I found the backquotes required by infix functions difficult to recognize--they look very similar to regular single quotes. Since Thompson does not mention this syntactic requirement when it’s first used (it’s explained later on), novices who attempt to copy and execute the code may be baffled by the inevitable errors they will meet. (They will not have this problem if they download the code from the book’s Web site, but I strongly believe that writing one’s own code is a vital part of the learning process and I encourage it.)
  • The index is missing some entries. Also, some entries in the index do not show the first page where the entry is used.
  • Thompson uses single quotes frequently; some of them are superfluous and should be eliminated and the rest should be replaced with italics. (The best way to encourage students to use correct grammar is to show it being used correctly.)
Nevertheless, my overall impression of this book is very positive and I recommend it for both classroom use and self-study.
Reviewer:  Edgar R. Chavez Review #: CR140135 (1209-0875)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Haskell (D.3.2 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Haskell": Date
Lava: hardware design in Haskell
Bjesse P., Claessen K., Sheeran M., Singh S. ACM SIGPLAN Notices 34(1): 174-184, 1999. Type: Article
Aug 27 2004
Programming in Haskell
Hutton G., Cambridge University Press, New York, NY, 2007.  184, Type: Book (9780521692694), Reviews: (1 of 2)
Aug 11 2008
Programming in Haskell
Hutton G., Cambridge University Press, New York, NY, 2007.  184, Type: Book (9780521692694), Reviews: (2 of 2)
Sep 19 2008
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy