DDD in Gleam
Ten katas in idiomatic Gleam
A 10-kata progression that teaches idiomatic Gleam through DDD’s vocabulary.
Welcome

A 10-kata progression that teaches idiomatic Gleam through the vocabulary of Domain-Driven Design. Each chapter pairs one DDD concept with the smallest Gleam toolkit that lets the compiler check it.
The chapter labels say DDD; the lessons are idiomatic Gleam.
Prerequisites
- A working Gleam toolchain (
gleamon yourPATH). - Comfort with one statically-typed functional or object-oriented language. The book assumes no prior Gleam.
How to work through it
- Read the concept and fundamentals sections.
- Open the source file under
src/and try the kata before peeking. The tests undertest/are the spec. - Run
gleam testto confirm. - Read the walk-through and critique, then compare to your version.
The reference solutions live in src/; the tests in test/ are their spec. The companion repository is at github.com/escherize/gleam-katas.
A note on style
Each chapter follows roughly this shape:
- Concept: the DDD idea in plain language.
- New Gleam fundamentals: what this kata needs that earlier ones didn’t cover. (Omitted when a chapter introduces no new language features.)
- The task: function signatures and rules.
- Hints: enough to unblock without spoiling the design.
- Walk-through: the reference solution, with reasoning.
- Critique: what holds up, what shifts as the system grows.
- Takeaway: the property the code now guarantees, and why it matters past the toy example.