Haskell: The Craft of Functional Programming

Paperback
from $0.00

Author: Simon Thompson

ISBN-10: 0201342758

ISBN-13: 9780201342758

Category: Programming Methodology

Search in google:

The second edition of Haskell: The Craft of Functional Programming is essential reading for beginners to functional programming and newcomers to the Haskell programming language. The emphasis is on the process of crafting programs and the text contains many examples and running case studies, as well as advice on program design, testing, problem solving and how to avoid common pitfalls. Electronic Review of Computer Books - Christopher Angus Haskell is over 10 years old now but still relatively few people are even aware of its existence. To the converted few, Haskell offers a powerful solution to problems encountered whilst building software systems. However, many find the learning curve incredibly steep and never get to appreciate its strengths or its advantages. Haskell: The Craft of Functional Programming is aimed at beginners and coaches the reader in both Haskell and in the rationale behind functional programming in general. As the title suggests, the emphasis of the book is on crafting functional programs and contains many (simple) examples and advice on how to avoid common mistakes when using one of the more popular implementations of Haskell, namely Hugs. Simon Thompson takes the reader from a point of knowing little or nothing about Haskell and introduces each of its language features in a well-paced chatty manner. It is no surprise that this book and its predecessor (Miranda: The Craft of Functional Programming) have been used as standard texts in many university departments. However, since this is a beginners book, more advanced techniques such as the monadic style of functional programming (a special kind of use of abstract data structure that allows functional programs to be structured more easily) is unfortunately given a very thin covering (12 pages), suggesting that the interested reader obtain one of the Springer-Verlag lecture notes series. Alongside this is the fact that often the only way to solve problems is to use libraries that have not made it into the Haskell standard yet. Reading and writing binary files is one example of this. This approach, while being fine for a teaching text, can leave the reader who is trying to solve a real world problems feeling more than a little unsupported. These points were recently emphasized when Haskell was used (outside the realm of academia) to prototype a language translation system. This system used techniques well known and well understood to the research community but yet to hit the bookstore shelves. This book was successfully used when my colleague joined the project, enabling him to rapidly get up to speed with the language and general concepts. However, there was still a large gulf between this point and the kind of code found in the project. This situation is perhaps analogous to the gulf between the war-scarred C++ hacker and the programmer who churns out the ubiquitous "hello world." However, walking into any bookstore confirms that the mainstream languages have widespread support and it is relatively easy to obtain a breeze-block sized text on just about any level of Java/C++. It is perhaps a little unfair to expect The Craft of Functional Programming to be all things to all men since as it excels as an introductory teaching text. Its only real competition being Paul Hudak's The Haskell School of Expression: Learning Functional Programming through Multimedia and it would be nice to see a pragmatic "Haskell used in anger" publication to follow either of these introductions.

Preface1Introducing functional programming32Basic types and simple programs233Reasoning about programs734Data structures: lists895Reasoning about lists1316Generalization1477Functions as values1718Classes in Haskell2039Checking types22110Algebraic types23911Case study: Huffman codes28112Abstract data types30313Lazy programming34514Input/output and interaction39715Program behaviour425App. A Functional and imperative programming451App. B Further reading461App. C Glossary465App. D Understanding programs471App. E Haskell operators475App. F Implementations of Haskell477App. G Gofer and Hugs errors479App. H Some useful functions485Bibliography491Index493