λ

haskell.day

a day for pure functions and elegant types

→β
haskell :: Lazy -> Pure -> Elegant

Haskell's type system is not a constraint -- it is a language for expressing program structure with mathematical precision. Every function declares its contract. Every value carries its proof. Types are the architecture; values are the inhabitants.

In a world of runtime exceptions and null pointer errors, Haskell offers a radical alternative: make illegal states unrepresentable. If it compiles, it is likely correct.

→β

Algebraic Data Types

Maybe
* -> *
Just | Nothing
Either
* -> * -> *
Left | Right
[]
* -> *
(:) | []

Sum types and product types compose like mathematical structures. Pattern matching decomposes them with exhaustiveness checking -- the compiler ensures every case is handled.

→β

Composition

F a F b G a G b fmap f fmap f nat nat
-- Functor composition law
fmap (f . g) == fmap f . fmap g

-- Monad bind
return a >>= f  ==  f a
→β

The Hierarchy

Functor
Applicative
Monad
MonadIO

Each layer builds on the last. Functor gives mapping. Applicative gives application. Monad gives sequencing. The hierarchy is not arbitrary -- it reflects the mathematical structure of computation itself.

→β

Haskell is a purely functional programming language. It has been since 1990. It will be, forever.