- Paperback: 448 pages
- Publisher: Prentice Hall; 2 edition (May 9, 1998)
- Language: English
- ISBN-10: 0134843460
- ISBN-13: 978-0134843469
- Product Dimensions: 6.6 x 1.1 x 8.8 inches
- Shipping Weight: 1.4 pounds (View shipping rates and policies)
- Average Customer Review: 3.2 out of 5 stars See all reviews (4 customer reviews)
- Amazon Best Sellers Rank: #595,385 in Books (See Top 100 in Books)
Getting the download link through email is temporarily not available. Please check back later.
To get the free app, enter your mobile phone number.
Introduction to Functional Programming using Haskell (2nd Edition) 2nd Edition
Use the Amazon App to scan ISBNs and compare prices.
Windows 10 For Dummies Video Training
Get up to speed with Windows 10 with this video training course from For Dummies. Learn more.
Frequently Bought Together
Customers Who Bought This Item Also Bought
Top Customer Reviews
B&W was dense, and magic. It reminded me of the first time I read the K&R C book, you're following along fine, and all of a sudden you're off the deep end!
The syntax, sort of ML-like adds to the 'magic' feel of it all. Overall I think it's a good book. But like with K&R, make this your second or third book, to ground you in the fundamentals after you've become somewhat familiar with the syntax and application of a particular fnal language.
That said, it covers a wide breadth of topics, and does justice to them as well. But this opinion comes from a newbie at functional programming, so caveat lector!
For me, it made me realise that there was a whole 'new' way of programming, vastly bigger than the few functions C++ had in its STL, and that C++ syntax mostly got in the way. However, perhaps because of this book, I never quite grokked Haskell/ML syntax either, though LISP I find easy (easier).
However, it is very dense and the reader should beware that many of the programs in the book don't work. I surmise that they are more intended to show the algorithm rather than the actual Haskell implementation.
In Haskell it is particularly important to pay attention to the details, which is why I give this book only three stars.
Here is an example of a program in the book that does not work.
On page 82 the author Richard Bird provides this sample implementation of the floor function:
floor x = searchFrom 0
where searchFrom = decrease . upper . lower
lower = until (<=x) decrease
upper = until (>x) increase
decrease n = n - 1
increase n = n + 1
The problem with that implementation is that it does not return an Integer value; rather, it returns a decimal (Double) value. Here's an example:
floor (-3.4) -- returns (-4.0)
That is wrong. The specification for floor says that it "maps a value of type Float to a value of type Integer." Clearly it is not producing an Integer result.
I will now explain how to revise floor so that it returns an Integer value.
The heart of the problem is with the until function.
Here is how Richard Bird implements it:
until :: (a -> Bool) -> (a -> a) -> a -> a
until p f y = if p y then y else until p f (f y)
It takes three arguments, p, f, and y. Look at the signature of that function. The type of the third argument, y, dictates the type of the other arguments and the type of the result--whatever type y is, the other arguments must be the same type and the result must be the same type.Read more ›
The good: Having said that, the author gives a very good explanation of some of the concepts that make functional programming different from other paradigms. Some of the explanations given in the book are by far better (and more in-depth) than what's found on the web. That's one of the reason is at times hard to read. For example, the section on curring is very good and raises points that I have not seen in other books/articles.