A complete practical field guide

Scala 3
Domain Design
& Typelevel
Stack Cookbook

Recipes for designing backend software that makes illegal states harder to express.

For intermediate Scala developers who already know the syntax and want working answers for the problems that arrive in a real codebase.

Get the complete cookbook →
Scala 3 Domain Design and Typelevel Stack Cookbook cover

This is not another introduction.

It won't make you a category theory scholar or walk you through a toy “hello world.” It is a complete cookbook: a problem, the right tool, a real example you can adapt, and a note about where it bites.

Use it when you need to model a domain where illegal states should not compile—or ship an http4s service with JWT auth before Thursday.

Inside the cookbook

Start with the domain.

Focused, self-contained recipes for the patterns that show up in a production Scala codebase. Dip in whenever there is a problem on your desk.

CHAPTER 01

Opaque types

Make values precise without paying a runtime cost.

CHAPTER 02

ADTs & enums

Model the states your system can actually be in.

CHAPTER 03

Smart constructors

Validate at the boundary and keep invalid data out.

“Working knowledge you can use on Monday morning.”
Complete edition

Build the kind of Scala
you meant to write.

The complete cookbook is available now on Leanpub.

Get the cookbook →