A day for pure functions

haskell.day

EST. 1990 · PURE / LAZY / TYPED

No 04 Vol. λ An annual celebration
scroll
CHAPTER 01

Three ideas, one elegance.

01

Pure Functions

Same input, same output -- always. No side effects, no surprises. A function is a contract between values, signed by mathematics. The compiler holds you to it; the world rewards you for keeping it.

f :: A -> B
02

Type Classes

Polymorphism without inheritance. A type class declares what it means to be comparable, showable, foldable -- and any type may opt in by proving it can.

class Eq a where
03

Lazy Eval

Compute only what you ask for. Infinite lists are merely lists you haven't finished asking about.

take 3 [1..]
A FUNCTION IN ONE ACT

quicksort

starring · concat · map · filter

quicksort :: Ord a => [a] -> [a]
quicksort []     = []
quicksort (p:xs) = quicksort smaller
                ++ [p]
                ++ quicksort larger
  where
    smaller = [x | x <- xs, x < p]
    larger  = [x | x <- xs, x >= p]
DIRECTED BY THE HASKELL COMMITTEE RUNTIME — O(n log n) avg
CHAPTER 02

A short genealogy.

From a faculty meeting in Portland to GHC 9.x — thirty-five years of refining what a function ought to be.

  1. 1987

    A committee forms

    FPCA, Portland. A standard for non-strict, purely functional languages is proposed. The work begins.

  2. 1990

    Haskell 1.0

    Named for Haskell Curry. The first report ships. Lazy evaluation and type inference become the house style.

  3. 1998

    Haskell 98

    A stable target for teaching, books, and tooling. The language settles into its lasting shape.

  4. 2003

    Monads everywhere

    The IO monad, do-notation, and the realization that pure code can describe impure effects with grace.

  5. 2010

    Haskell 2010

    A modern revision. Hierarchical modules, FFI, and a thriving ecosystem on Hackage.

  6. 2024

    GHC 9.x & today

    Linear types, dependent-typed extensions, and a community that still argues -- politely -- about laziness.

APPENDIX

Five axioms, recited.