This is a great book which I enjoyed reading and found more useful than other introductory Haskell texts with the exception of Bird, although it may not be the best choice if you are most interested in the practical aspects of the Haskell. The emphasis is on foundations and language features (which are all Haskell 98) are introduced as they occur naturally in the discussion of a number of Number Theory and Logic problems.
This book is well named -- it aims to teach the three disciplines of its title in equal measure and learning Haskell is presented as the channel for that, rather than being a goal in itself.
Was this review helpful to you?
The Haskell Road is a truly enjoyable little book.
What it is not: HR is not one of those vast towers of paper that introductory computer science books seem to have become. The kind of book that's called "Discrete Mathematics" and essentially contains all the stuff that nobody wants to teach but everyone wants you to know. Those books and the courses they support are often a student's first introduction to thinking about computing, and it's shameful. They are a patchwork of misaligned topics - and the students' thinking begins to resemble them, unsurprisingly.
Rather, the Haskell road is elegant - clean, concise, yet informal and approachable. Like the title says, it is an introduction to Logic, Maths and Programming. The book takes the enlightened viewpoint that these are unified concepts. The book begins by introducing basic Haskell syntax, and all of a sudden, we are implementing a prime number test. Simple; yes, but we also learn how to _prove_ that a procedure is a prime number test.
This approach continues throughout the book. The ideas of formal logic and deductive reasoning are made approachable by the fact that we implement the rules in Haskell. Sometimes, the exercise is in Haskell, and the answer is in logic. The point is that the reader is made from the first instant to see the equivalence, the shared foundations between these different means of expressing thought.
This is also one of the few books that teaches, explicitly, the means of proof. It does not do so abstractly, but quite straightforwardly, using the tools of formal logic. A few somewhat difficult chapters are the result (2-4); but they are greatly enlightened by enjoyable exercises.Read more ›
Most Helpful Customer Reviews on Amazon.com (beta)
25 of 27 people found the following review helpful
The math book all programmers should read2 Dec. 2009
- Published on Amazon.com
The 'Haskell Road to Logic' is a wonderful introduction to the mathematics that lie behind functional programming and computer science. Readers should however be aware that this book is not, and does not pretend to be, a book about programming in Haskell. It is really a text book about topics in mathematics that are of particular interest to computer scientists. What distinguishes the book from many others is its use of Haskell to implement mathematical structures that are usually taught as abstract concepts. This approach makes the mathematics far more approachable for computer programmers than many other text books. Presumably it should also make for an excellent introduction to computer programming for the mathematically inclined.
While the book is easy to read and has a friendly writing style, it not particularly well suited to casual reading. To really understand the subject being discussed the reader will probably need to solve most of the exercises in the text. The good news is this requires minimal prior mathematical training (the authors expect familiarity with "secondary school mathematics"). Solving the exercises will also train the reader in writing, and proving the correctness of, short functional programs.
The book has a minor few faults. One is a relatively large number of minor errors (many of which are noted in the errata available on the book's website). Another is that some major topics are introduced in exercises without much discussion, particularly in the later chapters. But these are but quibbles in a review of a fantastic math book for programmers.
71 of 84 people found the following review helpful
The Haskell Road to Discrete Math9 April 2006
John J. Rood
- Published on Amazon.com
Want to learn discrete math as in the non-calculus version of Math 101? Willing to work hard to learn it? Then this is the book for you! It is written in a user friendly style. The book has a chatty tone when explaining serious topics. The chat is the talk of experts, however, so it should never be underestimated. The book will teach you the functional programming language Haskell. This language is the most modern version of the Lisp family to have received any significant attention. It features advanced type features and lazy evaluation. The book covers all the "classic" topics of a discrete math course, to a considerable depth. Best of all, they are all implemented in Haskell. All except for the predicate calculus, that is. It would be a major piece of work indeed to have any implementation of this topic in a work at this level! The book teaches logic by example. One is taught the meaning, the rules and the insider's "recipes" of mathematical proofs. The book then covers the standard topics of sets, relations, functions, and induction / recursion with impressive computer implementations. The book goes on to a quick overview of the construction of the number systems of mathematics. It proceeds to a substantial treatment of combinatorics in a short space which includes implementation of polynomial solutions to recursion relations. Then it is on to corecursion, power series, and a hint of domain theory. The book ends with a modern chapter on the elements of set theory. All in all an excellent book! IMHO it is the best book out there on the topics in a discrete math course. It is amazing that all of this (except the serious parts of logic) could be implemented in Haskell so successfully. The one caveat about the book is that if you want to benefit fully from it, you are going to have to do some hard work.
29 of 33 people found the following review helpful
Lives up to the title but not for beginners!31 Jan. 2011
- Published on Amazon.com
After dabbling in several other programming languages I came across references to Haskell and quickly became interested in learning the language given (1) my disdain for over-sized and almost convoluted languages such as Java and C# and, (2) my background in Mathematics. Yes this is an interesting book that does an excellent job showing how well the abstraction of Mathematics can be quantified using Haskell yet, I do not believe that this book does any justice to those individuals the author claims the book is written for-"[t]his book does not assume the reader to have previous experience with either programming or construction of formal proof ...". Any inexperienced programmer or person with minimal Mathematical experience will, in no way, benefit from this book unless they have a quality teacher who can explain as well as expand on the material. In my humble opinion the person's who can utilize and benefit from this book are either semi-experienced functional programmers, young (possibly old) whiz-kids or the auto-didactic types who have the patience to refer to other sources for more explanation. As an example of the later claim, Exercise 1.10 asks the reader to "define a function called removeFst that removes the first occurrence of an integer m from a list of integers ..." without reference to working with/on lists. Further, this user defined function is expected to be used in the very next example (1.11) which, without assurance of the readers ability to define such a function, i.e. providing a solution, is pedagogically unsound. Either include a reference to the solution(s) on the authors website, include them in the book, or do a better job of NOT asking for chicken without providing the egg.
This is not meant to be a negative review! Instead, it is a warning to those with minimal programming/Mathematics background expecting to learn Haskell. Personally, I loved this book and wish I came across it years ago. In fact, I wish I had come across functional programming years ago and therefore had not wasted years trying abstract other less abstract-able languages.
14 of 15 people found the following review helpful
Enlightening17 Sept. 2010
- Published on Amazon.com
As a professional programmer who dropped out of college too early to get a good grounding in mathematics, this book has been a wonder to me. I've been trying to learn more advanced mathematics in the last year or so, and struggled because I didn't know how to do proofs.
Haskell is prominent in the title, but is secondary in the book. The vast majority of my time has been spent reading and performing proofs with with pencil and paper. The mathematics portions are all fairly rigorous. Once proofs are fully introduced, nearly all the exercises are proving theorems given in the book, or providing counter examples. There isn't much in the way of computational type exercises I've seen in some other discrete math texts, stuff like "what's the transitive closure of this relation". Instead, a theorem will be given and the author will ask you to prove it.
The Haskell exercises typically follow pure math introductions and exercises, and are used to help develop a stronger, more intuitive understating of the subjects. I can now write enough Haskell to take on the exercises, but to this point, the Haskell has all be very compact - 10 lines of code to answer a question at the max, usually more like 3. There's no way I could go and do something 'practical' with Haskell at this point, but I can grok some of it and am starting to appreciate functional programming.
This is easily the most challenging self study book I've taken on, but also the most rewarding. Not only have I gained proof writing knowledge, and a solid understanding of the fundamentals of modern mathematics, but it's helped me develop a measure of discipline in thought. I've noticed improvements in the clarity of my day to day software development - in design, development, and verification. The methodical approach to breaking down a proof into cases and sub-cases has been most helpful in that regard.
I recommend this to anyone, especially developers who haven't had the benefit of a thorough mathematical education.
14 of 16 people found the following review helpful
modern approach to Mathematics foundations7 Jun. 2009
Herbert C. Meyer
- Published on Amazon.com
When I was a Math undergrad back in the 70's, we had a 5 hr course called Foundations of Mathematics. This was an intro to symbolic logic, propositional calculus, and methods of proof. Deadly boring, dry material that we either knew, grasped by intuition, or ignored.
This textbook covers this material in a constructive fashion by using the Haskell programming language. Haskell is a modern form of lisp, one of the original programming languages, from the '50's, the language used for most Artificial Intelligence work. The breadth of Haskell allows it to be used for logic and proof, as well as the usual numerical and string processing. Pattern matching and list processing is built into the basic structure of the Haskell language.
This text's exercises are mostly Haskell programming assignments. Turning the abstract ideas of the math into the concrete statements of Haskell (if statements in a program can be considered concrete) will make the ideas familiar and real. Free, useful versions of Haskell (Hugs) are available for readers or students to use, even on Windows systems. Any familiarity with any programming system and a text editor should be enough to get started.
What is the difference between proving a theorem and debugging a program ? The way I do it, not much. That has much to do with me, I am a programmer first, and a Math second. This statement is the Curry-Howard correspondence, connecting computability and proof or truth. This text is a step on that road to truth.
There are several other titles in this series. All of them sound fascinating. I will read them later.