Notes: Haskell Programming from First Principles by Chris Allen & Julie Moronuki
Contents
- Chapter 01: All You Need is Lambda
- Chapter 02: Hello, Haskell!
- Chapter 03: Strings
- Chapter 04: Basic Datatypes
- Chapter 05: Types
- Chapter 06: Typeclasses
- Chapter 07: More functional patterns
- Chapter 08: Recursion
- Chapter 09: Lists
- Chapter 10: Folding lists
- Chapter 11: Algebraic datatypes
- Chapter 12: Signaling adversity
- Chapter 13: Building Projects
- Chapter 14: Testing
- Chapter 15: Monoid, Semigroup
- Chapter 16: Functor
- Chapter 17: Applicative
- Chapter 18: Monad
- Chapter 19: Applying Structure
- Chapter 20: Foldable
- Chapter 21: Traversable
- Chapter 22: Reader
- Chapter 23: State
- Chapter 24: Parser Combinators
- Chapter 25: Composing type
- Chapter 26: Monad transformers
- Chapter 27: Nonstrictness
- Chapter 28: Basic libraries
- Chapter 29: IO
- Chapter 30: When things go wrong
- Chapter 31: Final project
Preliminary Remarks
This page contains my notes and exercise solutions for the text “Haskell Programming From First Principles” by Chris Allen and Julie Moronuki.
Brief review: I love this book. I love Haskell. I worry this book has been so good at teaching me Haskell that I’m going to love other languages less by comparison. The book’s philosophy of “Let’s break complicated topics down into simple pieces, and then play with the pieces until they become obvious” is so effective that I’m going to just reflexively hold every other CS book to the same standard from now on. I suspect this is going to leave me very disappointed, since most other programming books aren’t anywhere near this fun.
Okay, maybe that’s a little hyperbolic. I don’t want to give the impression that HPFP is a text without flaws. I’ll probably talk about those flaws at some point, but before I do I want to make it perfectly clear that this book is spectacular and any criticism is made with the greatest possible love and affection.
I deeply admire what Julie Moronuki and Chris Allen have accomplished here, and I encourage anyone interested in programming to buy a copy at www.haskellbook.com. I am also eagerly awaiting Julie’s upcoming book The Joy of Haskell and Chris’ Haskell Almanac.
A little house-keeping first: My notes and exercise solutions, are not designed to make much sense without reference to the text itself. My intended reader is someone who has already bought HPFP and wants to check their own work against someone else’s. Please buy the book; supporting great authors now means more great books for everyone in the future.
Also, each chapter of HPFP has a list follow-up resources at the end. In my chapter notes, I’ll link to separate posts containing my notes on each of these resources.
Lastly, my GitHub repository containing my solutions for HPFP is here.