Editorial Review Product Description Functional programming, is a style of programming that has become increasingly popular during the past few years. Applicative programs have the advantage of being almost immediately expressible as functional descriptions; they can be proved correct and transformed through the referential transparency property. This book presents the basic concepts of functional programming, using the language HASKELL for examples. The author incorporates a discussion of lambda calculus and its relationship with HASKELL, exploring the implications for parallelism. ... Read more Customer Reviews (3)
An great second book for students of Haskell
Conceptually the content of this book can be divided into three major sections. The first is a well constructed overview of Haskell which, though not suitable as a primary tutorial, is organized in a building block style that clearly explains the core concepts of the language and their syntax. Examples are of minimal complexity and fit each purpose well while remaining free of yet unintroduced material. The other two sections, theory and implementation, are interleaved to present the material in a constructive way. The introduction to lambda calculus marks the first deviation from a pragmatic study of Haskell, however, proofs are largely omitted leaving mostly definitions, relevant theorems, and explanations. This book served as my introduction to lambda calculus and I found it somewhere between impenetrable and relaxing, which is to say that it was very helpful despite requiring a second read. The chapter closes with a desugaring of Haskell into the simpler constructs of lambda calculus. Next the properties of applicative languages are studied and implemented (in Haskell) on a SECD machine. Then lazy evaluation is studied and techniques of implementation such as SECD, graph reduction, SKI-combinators, and the G-Machine are covered. Following this is an overview of program transformations and optimizations with a brief summary of ongoing work in the field. The three conceptual topics; language, theory, and implementation are covered uniformly so there is a decreasing completeness to the Haskell presentations as abstractions pile up e.g. there is no concrete implementation of lazy evaluation. Instead the operation of machines is described with graphics or combinators in the notation of lambda calculus. This book covers implementation adequate for an intermediate command of Haskell while serving as an excellent introduction to the theory behind functional programming.
Excellent Introduction
Davie's book is aptly named; although he briefly outlines the important syntax of the Haskell language, this is not intended to be "How to Program in Haskell."This book is an introduction to the ideas of functional languages rather than a tutorial on the nuts and bolts of programming.As a result, many of the techniques of programming in Haskell are presented, but in the broader context of his explanation of functional programming rather than in the more narrow, "In Haskell, you must do x and y to accomplish z" sense.I thought that this was very effective; although I have used functional programming systems in the past this was the first time I had read a clear presentation of their theory and history.Parts of the book are very dense and make for heavy going, but overall I think Davie has done a very good job of introducing the reader to the idea of a functional programming language.
Interesting language
The Haskell programming language is part of the backlash against "big" languages such as Ada and C++. Although its syntax is not (not necessarily) like Lisp, it follows in the Lisp tradition of maintaining a tight bond to its roots in the formal logic of mathematics. And, like Lisp, it presents itself as a strict functional language.
Haskell has versatile syntax, allowing many different representations of any expression. It also supports high-order functions, or functions of functions. You'll also find a Prolog-like pattern matching facility (without the full capacity of Prolog's unification engine), which enables some kinds of overloading. The language supports "modules" as well, a limited kind of scoping mechanism intended to support programming in the large.
If "functional" programming is a term you haven't heard before, it means that, ideally, a program runs entirely in terms of expression evaluations without side effects - the program has no state except for transient state on its stack. This ultimately makes it a poor match to the real world. Even the ideas of storing a Haskell program on disk and holding its output pixels on screen violate the stateless paradigm, since that storage would be long-lived state. In the end, a functional programming language must violate its stateless purity to be relevant to commercial problem solving, or must leave state management to some part of the system outside of the language. The latter doesn't really solve the problem of state, it simply pushes the problem around - i.e. to some other programming language.
Haskell is an interesting exercise in language design, embodies many useful concepts from formal logic, and gives up many of the features that make it difficult to reason about programs in rigorous ways. It may have given up too much, though. When I try to picture using its techniques to solve systems of linear equations, write device drivers, or process a payroll, I end up with a very unpleasant image.
//wiredweird
... Read more |