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
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
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
Compute only what you ask for. Infinite lists are merely lists you haven't finished asking about.
take 3 [1..]
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]
From a faculty meeting in Portland to GHC 9.x — thirty-five years of refining what a function ought to be.
FPCA, Portland. A standard for non-strict, purely functional languages is proposed. The work begins.
Named for Haskell Curry. The first report ships. Lazy evaluation and type inference become the house style.
A stable target for teaching, books, and tooling. The language settles into its lasting shape.
The IO monad, do-notation, and the realization that pure code can describe impure effects with grace.
A modern revision. Hierarchical modules, FFI, and a thriving ecosystem on Hackage.
Linear types, dependent-typed extensions, and a community that still argues -- politely -- about laziness.
x = e means everywhere, always.IO () is a recipe, not an action.(.) is the smallest grammar.