λ

haskeller.net

A space for functional programming, type theory, and the pursuit of elegant abstractions.

About

This is the working notebook of a practitioner who believes that programming is a branch of mathematics, and that the most productive code is the code that was never written. Haskell is not merely a language here; it is a lens through which to examine computation, correctness, and the deep structure of problems.

The discipline of pure functional programming teaches us to think in transformations rather than instructions, in types rather than tests, in composition rather than inheritance. These pages collect the insights, patterns, and occasional frustrations encountered along that path.

λ

Writing

On the Algebra of Types

Sum types and product types are not merely convenient syntax. They form an algebra -- a semiring, to be precise -- that mirrors the arithmetic we learned as children. Understanding this correspondence transforms how we model domains and reason about the cardinality of our data.

Monads Are Not Burritos

Every monad tutorial fails for the same reason: it reaches for analogy before establishing the algebra. A monad is a monoid in the category of endofunctors. This is not obfuscation; it is the shortest path to genuine understanding. Let us walk it together, without metaphor.

Laziness as a Virtue

Non-strict evaluation is Haskell's most misunderstood feature and arguably its most powerful. By separating the description of a computation from its execution, laziness enables a style of programming where infinite data structures become practical tools and modular reasoning becomes natural.

Structural geometry: the convergence of line and curve in architectural space.
λ

Code

Selected examples that illustrate the principles discussed in these pages. Each snippet is complete, type-checked, and compiles with GHC 9.8.

-- A simple demonstration of the Reader monad
-- for dependency injection

module Config where

import Control.Monad.Reader

data AppConfig = AppConfig
  { appPort    :: Int
  , appHost    :: String
  , appVerbose :: Bool
  }

getGreeting :: Reader AppConfig String
getGreeting = do
  host <- asks appHost
  port <- asks appPort
  pure $ "Listening on " <> host <> ":" <> show port
-- Type-level natural numbers
-- Peano arithmetic at the type level

data Nat = Zero | Succ Nat

type family Add (a :: Nat) (b :: Nat) :: Nat where
  Add Zero     b = b
  Add (Succ a) b = Succ (Add a b)
The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise. Edsger W. Dijkstra
λ

Resources

A curated selection of texts and tools for the working Haskell programmer. These are not comprehensive lists but personal recommendations, tested through years of daily practice.

Essential Reading

  • Haskell Programming from First Principles Christopher Allen, Julie Moronuki
  • Category Theory for Programmers Bartosz Milewski
  • Thinking with Types Sandy Maguire
  • Algorithm Design with Haskell Richard Bird, Jeremy Gibbons

Tools of the Trade

  • GHC 9.8 The Glasgow Haskell Compiler
  • Cabal & Stack Build systems and package management
  • HLS Haskell Language Server for editor integration
  • Hoogle Search Haskell libraries by type signature

Contact

For correspondence regarding functional programming, type theory, or collaboration on Haskell projects, reach out via the channels below. Thoughtful inquiries are always welcome; the best conversations begin with a well-typed question.