Haskell Programming from First Principles: Part 1

Two weeks in, I take a look at why yet another beginner Haskell book matters, how it differs from what is already out there, and why that increases your chances of success as a learner.

I don't typically provide incremental progress reports or incremental reviews of books. I want to make an exception here, because this book provides significant actual value incrementally.

Haskell Programming from First Principles is not yet released, but the work in progress version available on Gumroad is ready for consumption. More than that it's possibly the best edited technical book I've ever read. The writing is good, the style is light and quirky, and the code works. That last point is extremely important since remarkably few programming books get that part down and the work Julie and Chris have done to get the code right is an extraordinary service to learners.

Haskell is not a hard language, but it will be like learning your first programming language unless you come from a statically typed functional programming background. There is enough novelty in terms of both the paradigm shift (purity, lazy evaluation) and the depth of the type system in Haskell that it is extremely likely that your existing understanding of programming and computation itself will hinder your progress. Consider learning Haskell like you are learning to program with entirely alien technology. No analogies are useful, clear your mind, and dive in fresh with no expectations or assumptions.

I've been learning and programming in Haskell since 2007. This process has had its ups and downs and up until starting this book I didn't feel I was gaining usable traction or intuition that I could apply independently. After reading Haskell Programming from First Principles for the past couple of weeks I haven't made it through an Earth-shattering number of chapters. I'm most of the way through chapter 6. However, what I have done is understood and retained everything I have learned in those chapters and felt a natural upward progression of confidence and intuition building. I have never felt this in working through other Haskell books.

My impressions of other books have always been that the exercises are needlessly rudimentary or absurdly difficult and burdened by incidental complexity. The examples and exercises in Haskell Programming from First Principles are obviously curated and developed with extreme care. Not only do they work correctly - as I have mentioned earlier - they also concisely address and reinforce material just introduced. There is a certain degree of pushing the envelope, but it is always just enough to inspire curiosity and never enough to discourage.

The pacing and order of the book was an unexpected and significant departure as well. It starts with a solid foundation in developing an intuition for how Haskell programs run computations. The Lambda Calculus is incredibly concise and the exercises and examples Julie and Chris provide really help build from simple direct understanding to the bootstrapping of how this model of computation scales up to great complexity without great complication. Something often relegated to appendices or external resources is rightfully made foundational as it gives you a solid intuition for how Haskell programs are structured and how they run.

Haskell Programming from First Principles won't talk down to you or provide half-true crutches to paper over complex concepts. Whenever the book defers explaining a concept it does so explicitly and justifies the decision so you don't feel compelled to seek answers that the book hasn't prepared you to effectively use. This is a tough balance, but I really feel like it has been effectively met.

I keep coming back to this concept of building intuition. I do this because it is incredibly important to a working programmer. Having a set of concepts and a mapping of what they are for really isn't sufficient. It helps you find answers on Google or StackOverflow, but it doesn't help you develop your own solutions or compose separate concepts in novel ways. If you can't do that with a programming language, then it isn't going to be profitable for you to use it. Haskell Programming from First Principles clearly values and reinforces the development of deep intuitive understanding of the concepts and builds upwards incrementally from previously taught concepts. The most profound thing for me was getting to a point of realizing that I was getting all of the exercises correct on paper the first time. I already have a lot of experience with Haskell, but I've never felt confident in it the way this book has made me feel.

At Chapter 6, I still have a lot of the book left to read and maybe I'll run into some horrible deal-breaker later on, but my impression so far is that is excellent and is making me a better programmer. Moreover, I feel very confident that less than a quarter of the way into the book I have already gotten well in excess of Haskell Programming from Principles' $59 price tag worth of value personally and professionally from it.