Functional programming no longer needs justification. It is a great way to program despite Niklaus Wirth’s comments [1]--he groups functional programming among those ideas that, under critical scrutiny, have lost their initial splendor and brilliance.
Computer science (CS) students ideally learn functional programming early in the curriculum, and professional programmers benefit from being acquainted with it--it certainly impacts how they think about programming, and they may need to use it at some point in their careers. Since Haskell is becoming the lingua franca of functional programming, it is definitely worth learning.
The Haskell Web site (http://www.haskell.org/) recommends this book as the best place to start learning Haskell. The tutorial is also available online (http://learnyouahaskell.com/). It is aimed at readers with previous programming experience. The presentation concentrates on teaching Haskell as a thinking and programming process. Lipovača occasionally feels the need to contrast concepts from imperative and object-oriented languages with Haskell.
This is a great book for self-study. In the CS curriculum, it can serve as an additional resource for learning the language; however, I would not recommend using it as a textbook. Lipovača expects readers to use the Glasgow Haskell compiler (GHC) and GHC’s interactive environment (GHCi) to execute the code shown, but the book’s coverage of GHC and GHCi is minimal--just what is needed to load and compile programs.
The book is organized into 14 chapters. Input and output (I/O) are covered about halfway through, in chapters 8 and 9. Until then, the code samples are very short; the benefit to this is that the reader can clearly see the points being made. Experienced programmers will note that Haskell can accomplish a great deal in a few lines, yet the code is compact and easy to read. By the time I/O makes an appearance, Lipovača can show interesting nontrivial examples that take advantage of what was already covered. The wait is worthwhile. For good measure, in chapter 10, Lipovača explains, in exhaustive detail, the development of two problems: a reverse Polish string calculator, and an attempt to find an optimal path to travel from Heathrow Airport to London. The explanation is straightforward without attempting to be theoretically complete, and then it’s back to the nitty-gritty of Haskell and small code segments.
This book will provide readers with a solid grounding in Haskell. It covers not only the expected basics, but also some advanced topics. Some sections will require repeated readings--and lots of experimentation with the language. Keep in mind Simon Peyton Jones’ insightful comment: “Any language large enough to be useful is dauntingly complex” [2]. The thoughtful reader will wisely follow up with other sources in order to really master the language; the Haskell site has some suggestions along these lines.
Regrettably, I must mention several minor shortcomings. The index lacks some entries that should have been included, and a few entries do not correspond to the place where the material is presented. GHCi options are provided as single-letter options; using full names would be better for beginners. Finally, my initial reading of folding (pp. 73-79) left me somewhat baffled--some of the statements need additional explanation or justification. The fact that folding stores deferred computations recursively on a stack is not explicitly mentioned until page 94, when strict left folds are covered. To appreciate the nuances of folds, I recommend Haskell’s tutorial (http://www.haskell.org/haskellwiki/Fold) and the links mentioned there.
Reading this book is both demanding and fun. I recommend it.