Why Haskell Matters

It's the types stupid

If you have not read the classic 1990 John Hughes paper Why Functional Programming Matters I urge you to do so. I won’t try to reproduce it here but assume you are familiar with its central thesis that pure, non-strict functions (of the kind that Haskell is interested in) are easier to compose, making their functional programs more scalable than procedural equivalents.

It all makes for a great read, but is it really true?

Everybody at the time felt it was true, and exhilaratingly so. But as the years have gone by with the widespread adoption of higher level programming systems like Ruby and Python I have noticed that the game has changed. These new systems provide many of the structures that could be used to express Hughes’s examples reasonably directly. Often my Rubyist colleagues would focus on how similar Ruby and Haskell were at their core once you got past the surface syntax, which only made me feel that they were missing the point.

Static Types

Programming Ruby is nothing like programming Haskell because of the static types of course. To illustrate this I took our most senior consultant Rubyist through a modest extension of our model’s API, modifying one of the the underlying types and listening to an audible gasp as the compiler marched me round the code base pointing the lines to change. At the next stand-up he explained that he now understood why we were using Haskell.

This is all old hat to contemporary Haskellers — by constructing your codebase with modern techniques you can enlist the type checker to maintain its coherence at scale as it evolves. Hindley-Milner type checkers came out of theorem proving and they allow us to apply logic at acale across the code base to adapt it to maintain its coherence.

Of all of the programming languages that are widely used at scale Haskell has the most well-developed static type system. That is why Haskell has the greatest potential for writing scalable code bases. That is why Haskell matters.

The thing is that this wasn’t really Hughes’s thesis. Does it matter?

Got an issue with any of this? Please share or drop me a line (see below).