Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

Programming in Haskell

Rate this book
Haskell is one of the leading languages for teaching functional programming, enabling students to write simpler and cleaner code, and to learn how to structure and reason about programs. This introduction is ideal for beginners: it requires no previous programming experience and all concepts are explained from first principles via carefully chosen examples. Each chapter includes exercises that range from the straightforward to extended projects, plus suggestions for further reading on more advanced topics. The author is a leading Haskell researcher and instructor, well-known for his teaching skills. The presentation is clear and simple, and benefits from having been refined and class-tested over several years. The result is a text that can be used with courses, or for self-learning. Features include freely accessible Powerpoint slides for each chapter, solutions to exercises and examination questions (with solutions) available to instructors, and a downloadable code that's fully compliant with the latest Haskell release.

184 pages, Paperback

First published December 31, 2006

215 people are currently reading
629 people want to read

About the author

Graham Hutton

2Ìýbooks22Ìýfollowers
I'm from Glasgow in Scotland, and received a BSc and PhD in Computing Science from the University of Glasgow. I then spent a few years in research positions in Gothenburg and Utrecht, before moving to Nottingham where I am now Professor of Computer Science. I'm married to Annette, and we have two lovely boys. In my spare time I enjoy cars, cooking, and football. Both of our boys play in football teams, and we are all season ticket holders for Nottingham Forest.

I'm Professor of Computer Science at the University of Nottingham, where I co-lead the Functional Programming Lab and am the Director of Research.

My research interests are in functional programming, with an emphasis on formally-based approaches to program construction and verification. My aim is to develop simple but powerful techniques for writing and reasoning about programs, by recognising and exploiting their underlying mathematical structure. My work covers a range of topics in this area, including functional parsing, relational programming, recursion operators, coinductive types, exceptions and interrupts, space and time complexity, concurrent programming, and program optimisation.

Current and recent work:

The under-performing unfold (2013);
Compilation à la carte (2013);
Work it, wrap it, fix it, fold it (2013);
Representing contractive functions on streams (2011).

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
181 (36%)
4 stars
198 (40%)
3 stars
91 (18%)
2 stars
16 (3%)
1 star
4 (<1%)
Displaying 1 - 30 of 51 reviews
Profile Image for Emre Sevinç.
174 reviews421 followers
February 5, 2017
This is a beautiful book for people who want to learn Haskell and functional programming as an advanced problem-solving tool.

First the good bits: The author's extensive university teaching and research experience shines throughout the book. Starting from the fundamental principles of functional programming, the author gently introduces the basic concepts and constructs of Haskell and strongly-typed functional programming. There are a lot of examples to demonstrate how the introduced concepts of Haskell and techniques of functional programming can be used to analyze and design solutions to problems of various complexity.

After introducing the basic building blocks of Haskell in the first part, the author goes on to introduce more complex topics such as monadic parsing, as well as modern Haskell concepts such as Applicative, Traversable and Foldable type classes. Following these, another very important notion, "lazy evaluation" is introduced and its usage is described, why and how it fits into Haskell explained with examples.

The exercises at the end of the chapter are carefully planned, and serve to force the reader's mind to understand concepts by forcing her to practice and think by herself.

I have to say that the final two chapters is where the book totally shines. First the author introduces what it means to reason about programs and shows how systematic thinking can be applied to designing a solution. In the chapter that follows, that is the final chapter, the reader sees the full power of the ideas developed in the previous chapter applied by calculating compilers, that is, starting from a specification for a programming language, to reaching a correct compiler that can parse the statements in that language and evaluate them to produce the results. The way to do is by using induction and realizing that this systematic method can be applied to languages of ever increasing complexity is mind-blowing moment in itself.

Now the not-so-good bits: Even though the books exemplifies how to break down problems into small pieces and how to compose small building blocks to create bigger and more complex Haskell solutions, it is definitely not enough for the "working programmer". That is, you will definitely learn a lot of important and critical Haskell principles and techniques from this book but you'll also miss a lot of other important aspects such as:

- A stronger focus on type-driven program design in Haskell
- Building Haskell projects and packages
- Writing tests, both traditional unit tests, and extensive automated QuickCheck style tests
- Profiling your programs
- How to properly benchmark your programs
- More detailed parsing techniques and libraries
- Web-based programming
- Network programming
- And few more topics that will be important if you're working in a team of Haskell developers, working to produce software products and services for your customers.

And you'll definitely need another book for that, the strongest contender being as of 2017 (see my review at .

Having said that, I'd still consider this Second Edition of Programming in Haskell by Hutton to be perfectly suitable for a modern Haskell introduction, provided that it is backed up by a teacher in a classroom environment; someone that can fill in the missing parts. The final chapters of the book will definitely appeal to programmers and students who want to continue their journey into the more research-oriented areas such as compiler design.

Overall, I'm more than satisfied to add this book to my Haskell and functional programming shelf, and whenever I'll need concise descriptions of fundamental as well as modern ideas, this will be among my go-to books for enlightenment.
Profile Image for Dima.
12 reviews2 followers
November 11, 2012
I think that it is a very good introductory academic text on Haskell that doesn't concentrate much on Haskell features but rather on functional programming and functional thinking. There are a lot of extended examples to reveal the nature of functional programming. I would also recommend the lectures by Erik Meijer based on this book on Channel9: .
Profile Image for Fotis Koutoulakis.
117 reviews13 followers
May 3, 2022
I **LOVED** this book.

Read this because I wasn't familiar with Haskell (even though I've been doing Racket, OCaml, F# for a while now...) and a number of books I was keen on reading next were using Haskell (it looks like a subset of the PLT community use Haskell as their medium of choice).

The book really stretched me in some of the chapters of the second part, but what I really liked was the questions (and answers) and the fact that **all** of the code runs as is (not always the case with some programming books).

Definitely one of the best programming books I've read thus far.
Profile Image for Dionysia.
18 reviews5 followers
August 9, 2017
This is such an excellent book, I wish there were more like it. So well designed it should be a blueprint for other programming books. Graham Hutton has a way of being succinct and clear so you spend more time thinking than reading. The exercises are interesting and get you to the next level.
Profile Image for Prashob.
110 reviews22 followers
July 21, 2024
Pretty clear and concise had to finish it for my masters! Although not a huge fan of Haskell!
Profile Image for ´³´Ç²õé.
16 reviews
December 9, 2014
Introducción simple y directa a la programación funcional, el lenguaje de programación Haskell y sobre como razonar sobre programas. Cada capitulo introduce conceptos, explica mediante ejemplos y finaliza con ejercicios para reforzar la comprensión de los temas tratados.
Profile Image for Rif A. Saurous.
181 reviews21 followers
May 27, 2018
A delightful little book on Haskell. I'd been exposed to Haskell before, so it wasn't entirely new to me, but this book definitely deepened my understanding. The book is concise, and focuses on the functional programming side of Haskell rather than for instance the programming-in-the-large side. Everything in it was material I wanted to learn better or review. This book (with some auxiliary web articles) pushed me over the line from basically being clueless about monads to basically feeling that I know what's going on (though of course there's still much more to learn). The last two chapters (in this second edition) detail some of the authors recent work on proving program correctness and calculating compilers, and I thoroughly enjoyed those though I wouldn't expect to see them in *every* book. The book has a moderate-sized but excellent bibliography: all of the later chapters point to the key articles that developed the topics and I know where to go to read more deeply. For those who are at all interested in functional programming, this is strongly recommended. I much prefer it to , which I find far too wordy and jokey.
28 reviews
February 9, 2024
Amazing introduction to Haskell. Can recommend to anyone who has the gonads to take on the monads.
Profile Image for Emmerson Siqueira.
2 reviews12 followers
February 14, 2019
This was my first book on Haskell and fundamentals in Functional Programming. I can say that it does a very good job at teaching them. It has a good balance between theoretical and practical advice. I could quickly grasp concepts and start writing some basic Haskell code. I enjoyed the examples and the exercises at the end of every chapter. In the second part of the book it goes in more advanced and complex topics. In this part I found that the author could give some more clearer and straight to the point explanations. I will for sure revisit the second part of this book, a few concepts take some time to sink in.
Profile Image for Michael.
162 reviews73 followers
December 12, 2010
For a book this short (~180) "Programming in Haskell" is a great introduction to the language. Clearly written, concise and to the point and with many exercises for the reader, it's easy to see that this book was written for teaching Haskell in a university context. I very much enjoyed this, more programming books should be like this.
1 review
January 5, 2020
Very good *introductory* book for learning Haskell. I particularly like the exercises at the end of each chapter. They are challenging but also really engaging which results in a great learning experience when you do them.

I think this book is one of the best materials for learning about how lazy evaluation works in Haskell.
58 reviews11 followers
August 2, 2016
good book for beginner, except two things:
1, it's a little old
2, it has too little about monads
28 reviews5 followers
September 14, 2018
I read the second edition of this book.

Let me summarise what I liked:

- To the point explanations.
- Extended examples were great for learning and getting used to of haskell syntax.
- Great exercises for learning.
- Covers quite a good amount of content in a small text.
- Thoroughly enjoyed the chapter on monadic parsing.
- Last two chapters are quite interesting. I had an intuition that reasoning about programs must be very challenging but it turns out that the ideas behind reasoning are quite approachable and the complexity depends on the program.
- One brilliant idea in the penultimate chapter was that mathematical induction can also help to generate optimizations of the program. I am not sure how far this can be helpful but certainly an awesome idea.

And few things that could have been better:
- For a first time learner, topics like monads, and applicatives could have been explained with more examples. Though the examples contained are good and motivating but few more examples would have helped. In general, I felt that topics which I already had some idea(in other language) were explained in good enough detail but topics which were new felt bit more terse and lacked examples.

- Few topics felt lacking the higher level view. For eg State Monad was introduced without any motivation and only later when we go to an example the reader gets to connect the dots.

Overall, I think this is a nice introduction to haskell for readers who already have some programming experience in other languages.
Profile Image for Quinn Dougherty.
56 reviews9 followers
January 3, 2020
great exercises. learned a ton.

first half is very straightforward- in hindsight, it felt mostly like list comprehension and other things which greatly improved my python programming. Being able to reason about maybes and functors makes a lot of basic programming things easier. The basic philosophy of most programming examples in the book is to "write backwards" with black boxes: if you can decompose a task into foo then bar, literally write down \x -> bar (foo x) before you write down anything else (certainly before you bother implementing the functions foo and bar). This philosophy also greatly improved my python programming.

Second half is where it gets weird-- applicative is really difficult for me let alone monads. but I've made leaps and bounds and now applicative is much less difficult for me and i can even reason about monads pretty well.

of course, it's important to do all the exercises! In 2018 I did all the exercises from part 1 and did a cursory reading of part 2, didn't return to do the part 2 exercises until late 2019. I'm excited to see how the latter's exposure to applicatives, monads, and parsing will effect my programming into 2020.

The last few chapters are some pretty serious PLT stuff that I fortunately learned in previous grinds at OPLSS and the first volume of Software Foundations, but they'd be really slow going if you weren't previously exposed to the concepts and methods.

Recommended to any programmer for sure.
Profile Image for Adam.
48 reviews9 followers
October 31, 2018
The first half of the text I think is good, although not exceptionally so, at explaining the syntax and ideas behind fairly standard Haskell features. It's main competition, Learn You A Haskell, is free and does at least as good a job. The second half of the book is about monads and monoids, which I still don't fully understand, and I think that is a reflection on the quality of explanation in this book (maybe it reflects on my own inability to grasp the topic too, who knows?).

It seems to me the book has in mind a reader who has worked in industrial or commercial applications using relatively deep programming concepts and techniques, just not the particular ones in Haskell--so there isn't a lot of need, in the author's mind, for explaining a lot of the surrounding concepts. It assumes the reader already mostly has these concepts clearly in mind, but just needs to learn how to implement them in this new language. For me that was very much not the case, and when picking up the book, I didn't realize this background understanding was assumed. I don't think the author fully realizes how much he assumes this in his explanations, too.
Profile Image for Chad.
273 reviews20 followers
April 27, 2020
This book is a fun way to bend one's mind into new shapes. It's reasonably well organized for reading straight through, up to the point where I stopped.

I didn't stop because I don't want to read the rest. I stopped because I knew that if I continued to the end now I wouldn't get enough from the rest of the book. Too much other stuff demands my attention to give Haskell the attention it deserves right now, and while I was able to get up to section 7.5 (halfway through chapter 7) without any real problems the cognitive load was getting a little heavy for me when I don't have the leisure to sit down at a computer and play around with Haskell for an hour each day to help me absorb what I've been reading.

If you want to learn some interesting mathematical concepts, this book could actually serve to help you. Some people have difficulty learning "pure" math, but get along much better learning the exact same concepts via programming. This book is densely packed with that kind of thing. Give it a try.

I don't know when I'll get back to Haskell, but when I do I'm pretty sure I'll be happy to have this book near at hand. It's dry, but clear, interesting, and instructive.
2 reviews
January 5, 2018
Is a good companion book for a virtual course like this , it is more focused on functional programming rather than haskell in my opinion, lot of exercises ! If you do all exercises at the end of every chapter then you will find that this is a good book, is not a book to read, is a book to practice, but you should read other haskell books as well if you (as me) are not an experienced mathematician, this one really help me too: which is free and well written and explain all the obscure things of Haskell in a more common way.
2 reviews
Read
January 2, 2019
Exceptional but badly formatted. Code contains zero annotations line-wise. I had to rewrite the entire book to fit my formatting needs. Content is otherwise exceptional and spectacularly conscise despite the book being written like a novel from the early 90's. Also love that the code is writen with actual pseudo-code symbols with real arrows instead of artifacts such as "->". The prettified compiled LaTex could need some syntax colorizing but. Despite all this its a fantastic little book on about 120pages for true lovers of type-safe functional languages. Could need some slight update to correspond to the evolution of Haskell itself.
32 reviews
February 28, 2024
Amazing when my lectures were literally him reading this book and screen sharing the terminal lol! Overall really useful and a great guide to learning Haskell. Didn’t cry when learning this language! But did have an hour and a half long session with my tutor on the very basics of Haskell bc I could not for the life of me get it into my head. (Coming from someone who’s other software languages are Java and VB)
3 reviews
June 19, 2020
A great introduction to Haskell

Graham Hutton is a master. This book is a masterpiece of functional programming and lazy evaluation. Definitely a must for anyone who wants to get into functional programming
6 reviews
September 1, 2023
Good introduction to Haskell, with several exercises to help you to quickly grasp the basic concepts of this wonderful language!

It is however, not enough to deeply learn about it. So make sure you don’t rely on this book solely if you want to dive deeper into the advanced features of Haskell.
Profile Image for Richard.
AuthorÌý4 books12 followers
June 25, 2017
There's a newer version. Go read that one instead.
Profile Image for Rohit.
21 reviews5 followers
April 29, 2018
I wish there were more questions at the end of the chapter. Very well written, succinct just like the language itself.
9 reviews1 follower
January 13, 2021
being my first book for getting into haskell, and coming from a Scala/Java background it's great to start with. Took sometime to get some basics down, but overall it's great.
10 reviews
Currently reading
August 10, 2022
Neeeeeerd. But seriously, this was actually very good as an introduction to Haskell. I went from being totally lost to "I kinda get what's goin on here now" after the first few chapters.
Profile Image for Wenceslao.
49 reviews1 follower
September 24, 2023
Loved this book as a Haskell introductory book. States in a simple way how to use Haskell, putting all the mumbo-jumbo in a clear and easy way to understand.
Displaying 1 - 30 of 51 reviews

Can't find what you're looking for?

Get help and learn more about the design.