Haskell is a purely functional language that allows programmers to rapidly develop clear, concise, and correct software. The language has grown in popularity in recent years, both in teaching and in industry. 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 this book accessible to a broad spectrum of readers. While Part I focuses on basic concepts, Part II introduces the reader to more advanced topics. 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.
Table of Contents
Part I Basic Concepts
Chapter 1 Introduction
Chapter 2 First steps
Chapter 3 Types and classes
Chapter 4 Defining functions
Chapter 5 List comprehensions
Chapter 6 Recursive functions
Chapter 7 Higher-order functions
Chapter 8 Declaring types and classes
Chapter 9 The countdown problem
Part II Going Further
Chapter 10 Interactive programming
Chapter 11 Unbeatable tic-tac-toe
Chapter 12 Monads and more
Chapter 13 Monadic parsing
Chapter 14 Foldables and friends
Chapter 15 Lazy evaluation
Chapter 16 Reasoning about programs
Chapter 17 Calculating compilers
Appendix A Selected solutions
Appendix B Standard prelude
1