Book Cover


Programming in Haskell

2nd Edition

Graham Hutton, University of Nottingham

Cambridge University Press, 1st September 2016

Paperback: ISBN 978-1316626221; Kindle: ASIN B01JGMEA3U

318 pages, 120 exercises


Haskell is a purely functional language that allows programmers to rapidly develop software that is clear, concise and correct. This book is based on the author's experience of teaching Haskell for more than twenty years. All concepts are explained from first principles and no programming experience is required, making the book accessible to a broad spectrum of readers.

Part I introduces the basic concepts of pure programming in Haskell and is structured around the core features of the language. Part II covers impure programming and a range of more advanced topics. The book contains many extended programming examples, and each chapter includes a series of exercises and suggestions for further reading.

This new edition has been extensively updated and expanded to include recent and more advanced features of Haskell, new examples and exercises, selected solutions, and freely downloadable lecture slides and example code. The presentation is clean and simple, while also being fully compliant with the latest version of the language, including recent changes concerning applicative, monadic, foldable and traversable types.

Graham Hutton is Professor of Computer Science at the University of Nottingham. He has taught Haskell to thousands of students and received many awards for his teaching. Hutton has served as an editor of the Journal of Functional Programming, Chair of the Haskell Symposium and the International Conference on Functional Programming, Vice-Chair of the ACM Special Interest Group on Programming Languages, and he is an ACM Distinguished Scientist.


Part I. Basic Concepts:
1. Introduction
2. First steps
3. Types and classes
4. Defining functions
5. List comprehensions
6. Recursive functions
7. Higher-order functions
8. Declaring types and classes
9. The countdown problem
Part II. Going Further:
10. Interactive programming
11. Unbeatable tic-tac-toe
12. Monads and more
13. Monadic parsing
14. Foldables and friends
15. Lazy evaluation
16. Reasoning about programs
17. Calculating compilers
Appendix A. Selected solutions
Appendix B. Standard prelude

The table of contents, foreword, preface and first two chapters can be viewed here.


This book will make you a much better programmer.
-- Erik Meijer, Facebook

The monad stuff alone is worth the price.
-- Neil Mitchell on twitter

This is a beautiful book for people who want to learn Haskell.
-- Emre Sevinc on

This book is a gem and I cannot recommend it highly enough.
-- Guillaume Koenig on

I have seldom encountered a book so well written as this one and still so complete.
-- Gilberto Filè on

The presentation of each topic, the exercises, and the writing in general, are all superb.
-- Peter Summerland on

A wonderful introduction to the alien world of Haskell.
-- Jon Janzen on

Concepts are clear, concise and well-explained.
-- Adrian Wong on

The author's deep understanding of Haskell shines through the writing.
-- Eli Bendersky on

Buy this book or pester someone to buy it for you. It's worth it.
-- Vilem-Benjamin Liepelt on

Loved it! Distilled complex concepts to simple components.
-- Dragan Glumac on

Amazing book!
-- Chris Hiew on

I really can't recommend this book enough.
-- Jose Lopez on goodreads

This is such an excellent book, I wish there were more like it.
-- Dionysia Sofos on goodreads

I recommend it highly.
-- Simon Thompson in Computing Reviews

The precision and concision is a benefit over so many other programming books.
-- Harald Bögeholz in c't magazine

The second edition is awesome!
-- Reynaldo Cordero on futurelearn

Clean writing, careful exposition, wonderful examples & valuable exercises.
-- Brody Berg on twitter

Refreshing brevity compared to any other book I've seen.
-- Bodil Stokke on twitter

Grab Hutton's new edition of Programming in Haskell, it's wonderful.
-- Rein Henrichs on twitter

The best book to learn Haskell the right way.
-- Truong Hoang Dung on twitter

Absolutely sublime book that made me finally "get" Haskell.
-- Timmy Jose on twitter


Lecture slides for chapters 1-10 are available in a zip file. These slides may be used or modified for any educational or training purpose provided the original author is acknowledged.


Haskell code for all the extended programming examples is available in a zip file.


Supporting videos are available for the chapters on the countdown problem, monads and more, lazy evaluation, calculating compilers, and there is also a video interview about the new edition.


Course instructors can request an inspection copy of the book, together with a large collection of introductory and advanced exams and answers based on the content.


All known errata are listed here.

Please contact the author if you spot any further issues.