A pilgrimage, on the web

Haskell
Heaven

A sweeping survey of Functional Programming — the Zen of the math underneath it, the beauty of code that never lies about what it does, and the vantage points Category Theory opens up once you climb high enough.

Map of the five vantage points

The Trail

Eleven stops, in order. Follow the path, or jump ahead — it's your pilgrimage.

  1. 00 Overview The Pilgrimage Welcome to a sweeping survey of Haskell Heaven: a travelogue through the vantage points that make Functional Programming beautiful.
  2. 01 Foundations Base Camp: A Whirlwind Tour of the Haskell Landscape Type signatures, pattern matching, guards, currying, sections, lambdas, recursion — the practical vocabulary every later chapter assumes you already have. If any of this is new, start here. If none of it is, skip ahead with a clear conscience.
  3. 02 Lambda Calculus Lambda Calculus: The Engine Underneath Before there was Haskell, before there were computers at all, Alonzo Church wrote down a system with three rules that turned out to be able to compute anything computable. Every function you will ever write in Haskell is that system, wearing nicer syntax.
  4. 03 Foundations What IS a Function? The single most common beginner mistake: assuming functions are about numbers. They're about mappings — from anything, to anything.
  5. 04 Foundations Types: Sets in Disguise Types aren't red-tape the compiler makes you deal with — they're the domains and codomains from Chapter 3, made explicit and checked for you.
  6. 05 Immutability Immutability: Equations, Not Instructions In Haskell, x = 5 isn't an instruction to store 5 in a box called x — it's a mathematical equation, true for the rest of the program's life.
  7. 06 Laziness Laziness and Infinite Data Haskell can define AllPositiveIntegers as an honest, infinite list — and find primes among them — because nothing gets computed until you actually ask to see it.
  8. 07 Purity Purity and Side Effects A pure function's entire relationship with the world is its inputs and its return value — everything else lives in IO, a type that turns 'having an effect' into 'being a value.'
  9. 08 Concurrency Beautiful Concurrency Simon Peyton Jones called it Beautiful Concurrency for a reason: once effects are values (Chapter 7), a transaction can simply be thrown away and retried if it conflicts — turning one of programming's hardest problems into a small, composable idea.
  10. 09 Category Theory Functors: Mapping Over Context The first proper Category Theory concept in Haskell: a Functor is anything you can map a function 'inside' — a list, a Maybe, a tree, a future computation — without changing its shape.
  11. 10 Category Theory Applicatives: Functions in Context Functor lets you map a plain function over a context. Applicative lets the function itself be wrapped in that same context — which is exactly what you need to combine several independent effectful values.
  12. 11 Category Theory Monads: Sequencing with Context The concept with the scariest reputation in all of Haskell, and the simplest honest description: a Monad lets one context-carrying step decide what happens next, based on what the previous step actually produced.
  13. 12 Pearls Pearls: Beauty in Small Programs A gallery of short, famous Haskell programs — Quicksort and Mergesort with no swaps or mutation at all, primes tested against the literal textbook definition, and an infinite list of Fibonacci numbers defined in terms of itself — each one a small, complete demonstration of everything this book has covered.

About this pilgrimage

Like any travelogue, this is a rambling set of essays about beautiful vistas in the landscape of Functional Heaven that is Haskell — functions that mirror their mathematical counterparts, inspiration from Category Theory, lazy evaluation that lets you work with infinite data, and purity that lets you actually reason about what your program does.

Every diagram on this site is hand-drawn to match the prose it illustrates — nothing generated, nothing stock. For book and paper recommendations, see Further Reading.