λ

haskell.day

A quiet language for loud problems

II

Purity

pure :: a -> f a
(<*>) :: f (a -> b) -> f a -> f b

In Haskell, functions are pure by default. No side effects. No surprises. A function called with the same arguments will always return the same result — a mathematical truth embedded in code.

f(x) input output
III

Types

data Maybe a = Nothing | Just a

click to explore

The type system is your proof assistant. Maybe encodes the possibility of absence directly in the type — no null pointer exceptions, no runtime surprises. The compiler verifies your logic before a single byte executes.

Nothing Just a Maybe a
IV

Composition

(.) :: (b -> c) -> (a -> b) -> a -> c
f . g = \x -> f (g x)

Functions compose like mathematical morphisms. Small, precise functions combine into complex transformations — each piece comprehensible, the whole provably correct.

a b c g f f . g
V

Monads

class Monad m where
  return :: a -> m a
  (>>=)  :: m a -> (a -> m b) -> m b

click to explore

A monad is a design pattern for sequencing computations. It's not about burritos or boxes — it's about composing effects. IO, State, Maybe, List — each monad encapsulates a different computational context while preserving the elegance of pure composition.

m a a -> m b (>>=) m b
VI

Laziness

fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
take 10 fibs -- [0,1,1,2,3,5,8,13,21,34]

Haskell is lazy by default. Values are computed only when needed. Infinite data structures become natural — an infinite list of Fibonacci numbers exists peacefully in memory, yielding values on demand.

0 1 1 2 3 ? ? evaluated ← → thunks
λ
VII

Begin

Haskell is not a language you learn in a weekend. It is a language that reshapes the way you think about computation. Every function you write becomes a theorem. Every program, a proof.

haskell.day — a quiet meditation on functional purity