No description
  • Haskell 85.7%
  • C 11.5%
  • Nix 2.4%
  • Shell 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-27 10:20:54 +02:00
funct-intro Initial import: functional programming intro course (11 lessons, cheatsheet, foundations lesson) 2026-06-22 13:56:28 +02:00
haskell harness: extensible coding-agent with typed tools, event bus, tests 2026-06-24 09:13:28 +02:00
learn-haskell-music music 2026-06-27 10:20:54 +02:00
my-code Initial import: functional programming intro course (11 lessons, cheatsheet, foundations lesson) 2026-06-22 13:56:28 +02:00
nix Initial import: functional programming intro course (11 lessons, cheatsheet, foundations lesson) 2026-06-22 13:56:28 +02:00
.gitignore harness: extensible coding-agent with typed tools, event bus, tests 2026-06-24 09:13:28 +02:00
README.md Initial import: functional programming intro course (11 lessons, cheatsheet, foundations lesson) 2026-06-22 13:56:28 +02:00

Functional Programming — A Two-Track Companion Course

Two parallel learning tracks, reinforcing each other:

Track Focus Language Goal
Haskell Functional programming — types, purity, monads, type-driven design Haskell Learn to think in pure functional terms
Nix Functional devops — reproducible builds, declarative systems, NixOS Nix (the language) + NixOS Apply functional principles to infrastructure

Why pair them?

Haskell and Nix share deep DNA: both are purely functional, both treat configuration and programs as evaluable values, both prioritise reproducibility. The Haskell track teaches you the ideas; the Nix track shows those ideas at work on real systems — packages, services, entire operating systems.

Haskell concept Nix counterpart
Pure functions Nix derivations (same inputs → same output)
Immutability The /nix/store (content-addressed, never mutated)
Type classes mkDerivation, callCabal2nix, etc. (combinators)
Laziness Nix's lazy evaluation of derivations
Monadic IO The Nix evaluator + builtins.derivation
Algebraic data types Nix attrsets + the rec keyword

Structure

functional-programming/
├── README.md          ← you are here
├── haskell/
│   ├── HASKELL_OVERVIEW.md   ← start here
│   ├── PATTERNS.md
│   ├── ALLIUM_RESEARCH.md
│   ├── allium-hs/            ← standalone experiment
│   └── lesson-1 .. lesson-5  ← the Haskell course
└── nix/
    └── README.md             ← placeholder (course not yet started)

How to use this repository

Each lesson is self-containedcd into it, run nix develop, follow LESSON.md. No global state, no setup beyond having Nix installed.

The recommended order:

Haskell track

  1. Lesson 1 — Your first TUI: pure state, pattern matching, the Elm architecture
  2. Lesson 2 — Async, BChan, HTTP, JSON (talking to DeepSeek)
  3. Lesson 3 — Types-first design: a decoupled agent protocol over NDJSON
  4. Lesson 3a — Refactor with view models and command types
  5. Lesson 4 — Testing pure functions: Hspec + QuickCheck
  6. Lesson 5 — Real streaming via SSE (the protocol's Token/Done finally used)

Nix track

Planned. Will cover: Nix the language, derivations, flakes, NixOS modules, declarative services, dev shells, and Haskell-on-Nix integration. Each lesson mirrors the Haskell worklog style.

Prerequisites

  • Nix installed (with flakes enabled)
  • A terminal that supports Unicode (for the TUI lessons)
  • For lessons 2+: a DeepSeek API key in ~/.pi/agent/auth.json (or modify the backend to use another OpenAI-compatible endpoint)

Tooling

Every lesson ships a flake.nix providing:

  • GHC (Haskell compiler) or nix itself
  • cabal-install (build tool)
  • haskell-language-server (IDE backend)
  • ghcid (instant feedback loop)
  • Hoogle (offline type search)

Run nix develop in any lesson directory. That's it.