Skip to content

Type-Driven Design Reading Paths

Study material for the section, grouped by goal. The map lists each source once, with where it’s held and what it’s for; the three sections after it are the original reading paths, with their explanations. General functional-programming books (Płachta, Pilquist, Welsh, Volpe, Allen, Kurt, Skinner, Parsons, Bragilevsky, Maguire) are placed in Fp Reading Paths; this note lists only their type-related chapters.

The map

Each source appears once. [lib] means it’s in the library, [web] that it’s free online, [–] that it’s named here but not held.

Core: designing with types (in this order)

  1. King, “Parse, don’t validate” [lib], then “Names are not type safety” [lib]. Short; the central idea and its main caveat. -> Parse Dont Validate
  2. Wlaschin, Designing with Types series [web], or his one-hour talk [web]. A free introduction to the book.
  3. Wlaschin, Domain Modeling Made Functional [lib], chapters 4-7, then 10-13. The main book: types, integrity, workflows, errors, serialization, persistence, evolution. For the domain-driven design vocabulary it builds on (bounded contexts, context mapping, value objects, aggregates), Vernon, Domain-Driven Design Distilled [lib], chapters 2, 4 and 5, is the shortest overview, and Khononov, Learning Domain-Driven Design [lib], chapters 3-4, 6-7 and 9, goes deeper. -> Domain Modeling With Types, Workflows And States, Types At The Boundary
  4. A language track:
    • Scala: Płachta, Grokking Functional Programming [lib], chapter 7, “Requirements as types” (beginner); Volpe, Practical FP in Scala [lib], chapter 1 (Scala 2 libraries); Volpe, Functional Event-Driven Architecture [lib], section 4.1 and chapter 4 (the same ideas with Scala 3 opaque types and Iron); Odersky et al., Programming in Scala [lib], section 17.4 and chapter 20; Wampler, Programming Scala [lib], chapters 9, 16 and 17; De Goes et al., Zionomicon [lib], appendices 1-2 (union and intersection types, Any and Nothing, variance). Schwarz’s Scala 3 by Example: ADTs for DDD [lib] puts Wlaschin’s F# beside Scala 3. -> Scala Type System
    • Haskell: Kurt, Get Programming with Haskell [lib], lessons 12-13 and 16, with the unit 3 opener on programming in types (beginner); Allen and Moronuki, Haskell Programming from First Principles [lib], chapters 11-12; Skinner, Effective Haskell [lib], chapter 4, “Creating Type Aliases”, and chapter 5, “Choosing What to Export” (smart constructors, phantom types and export lists); Parsons, Production Haskell [lib], chapters 10-12 (“Type Safety Back and Forth”, “Keep Your Types Small…”, “The Trouble with Typed Errors”) and chapter 15 (“Growing Pains”, on breaking changes).
    • TypeScript: Effective TypeScript [–], Total TypeScript workshops [web], Riscutia’s Programming with Types [–].
    • Rust: Rust for Rustaceans [–].
    • Java: Bloch, Effective Java [lib], Items 17, 23, 34, 50, 55, 62 and 88, and Urma, Fusco and Mycroft, Modern Java in Action [lib], chapter 11 (Optional in place of null): the same ideas in an object-oriented language.
  5. Errors and validation in practice: Pilquist et al., Functional Programming in Scala [lib], sections 4.4.1-4.4.2 (“Accumulating errors”, “Extracting a Validated type”) and section 12.4.1 (“Validated: An Either variant that accumulates errors”); Welsh and Gurnell, Scala with Cats [lib], chapter 10, “Case Study: Data Validation”.
  6. Architecture around the model: Ghosh, Functional and Reactive Domain Modeling [lib], chapters 3-5 and 10; Volpe 2021, chapter 2 on tagless final; Granin, Functional Design and Architecture [lib], chapter 13; Parsons, Production Haskell [lib], chapters 5-7 (“Three Layer Haskell Cake” and decomposing effects). -> Functional Domain Modeling, Effects And Interpreters

Branch: evidence and proof-carrying types

  1. Noonan, “Ghosts of Departed Proofs” [lib]. -> Strength Of Evidence
  2. Kleppmann, Designing Data-Intensive Applications [lib], chapter 5, and Helland, “Data on the Outside versus Data on the Inside” [lib], for what happens to types once data is stored and sent across boundaries. -> Types At The Boundary

Branch: theory

  1. Krishnamurthi, Programming Languages: Application and Interpretation [lib], “Safety and Soundness”, “Type Inference” and “Gradual Typing”, or Scott and Aldrich, Programming Language Pragmatics [lib], chapter 7 (“Type Systems”). Gentler starts than TAPL. -> Type Systems
  2. Pierce, Types and Programming Languages [lib], selected chapters (listed under Type theory and refinement types), plus section 19.3 on nominal and structural types.
  3. Wadler, “Propositions as Types” [lib]. -> Types As Propositions
  4. Jhala, Seidel and Vazou, Programming with Refinement Types [lib], with Vazou’s Liquid Haskell course [web]; Rondon et al., “Liquid Types” [lib]. -> Refinement Types
  5. Towards dependent types: Maguire, Thinking with Types [lib], chapter 15 with the chapters it builds on (2, 5 and 6) and section 1.4 on Curry-Howard (read alongside Hackett’s JFP review [lib], which separates cardinal arithmetic from Curry-Howard), Bragilevsky, Haskell in Depth [lib], chapters 11 and 13, and Parsons, Production Haskell [lib], chapters 20-22 (type-level programming and its trade-offs), as Haskell routes; Brady, Type-Driven Development with Idris [–]; The Little Typer [–]; Programming Language Foundations in Agda [web]; Software Foundations [web].
  6. Harper, Practical Foundations for Programming Languages [lib], as the advanced reference.

Two names are easy to confuse: Sandy Maguire’s Algebra-Driven Design [–] (deriving abstractions and tests from the laws of a domain) is a different book from his Thinking with Types [lib] (type-level programming in Haskell).

Practical type-driven design

The following reading suggestions focus on software design with types.

The strongest recommendation for this focus is Scott Wlaschin – Domain Modeling Made Functional (PDF). It covers things like replacing primitive values with domain types, making invalid states unrepresentable, modeling workflows as functions, representing errors explicitly, validation at boundaries, keeping I/O outside the domain model, serialization/persistence, and evolving the model as requirements change. (Pragmatic Bookshelf)

For the F# to Rust / Scala / TypeScript mapping, see Domain Modeling With Types.

There’s also a free Designing with Types article series by Wlaschin. It explicitly covers adding meaning to primitive types, making illegal states unrepresentable, discovering domain concepts through types, explicit state machines, constrained strings, dates, etc. (F# for Fun and Profit)

Designing with Types series

Schwarz’s slides Scala 3 by Example: ADTs for DDD (PDF) follow the book’s F# examples with Scala 3 versions side by side, which makes them a good companion for readers working in Scala.

His ~1 hour talk is a suggested introduction before buying a book:

Domain Modeling Made Functional – Scott Wlaschin

The second recommendation is Vlad Riscutia – Programming with Types. This one uses TypeScript and is deliberately aimed at working programmers. It moves from primitives and data structures through functions, composition, generics, and more advanced abstractions, with the goal of using types to produce safer and easier-to-maintain software. (Simon & Schuster)

The distinction between the two is useful:

Domain Modeling Made Functional
    "How should I represent my domain?"

Programming with Types
    "How should I use types when designing software?"

For domain modeling with types, the suggested first book is Domain Modeling Made Functional.

The next suggestion is Alexis King’s short article “Parse, don’t validate” (HTML). It captures one of the central practical ideas of this whole approach. (Lexi Lambda) See Parse Dont Validate.

For TypeScript specifically, Effective TypeScript, 2nd ed. is also useful. It’s much more about using TypeScript well in production than domain modeling, with 83 concrete guidelines and updated material on generics and type-level programming. (Effective TypeScript)

For exercise-based study, Total TypeScript has hands-on workshops on unions, generics, branded types, type predicates and advanced application/library patterns. (Total TypeScript)

For Rust, the additional suggestion is Rust for Rustaceans. It isn’t a domain-modeling book, but for readers who already know Rust, it covers API design, traits, ownership, error handling, and using Rust’s type system to design ergonomic APIs. (Penguin Random House)

Two books are suggested for deeper study afterward.

Type-Driven Development with Idris – Edwin Brady shows what happens when you push the same philosophy much further. Types guide implementation; later chapters model state machines, protocols, state changes and concurrency in the type system. (Simon & Schuster)

And Algebra-Driven Design – Sandy Maguire (not in the library; his Thinking with Types, which is, is a different book) is about deriving good abstractions from the operations and laws of the domain, including deriving implementations and tests from the model. It’s much more advanced and Haskell-heavy. (Leanpub)

Proposed practical curriculum:

1. Scott Wlaschin
   Designing with Types              ← free, short

2. Scott Wlaschin
   Domain Modeling Made Functional   ← main book

3. Alexis King
   Parse, Don't Validate             ← very short, important idea

4. Programming with Types            ← broader perspective

5. Language-specific practice
   TS    → Effective TypeScript / Total TypeScript
   Rust  → Rust for Rustaceans
   Scala → apply the same patterns with enums,
           opaque types, Either, refined types, etc.
           (books: see the Scala track in The map)

6. Later:
   Type-Driven Development with Idris
   Algebra-Driven Design

Useful search terms are type-driven design, domain modeling with types, algebraic data types, making illegal states unrepresentable, parse don’t validate, smart constructors, newtypes, opaque types, typestate, value objects, and type-safe API design.

Together, these terms describe this area more precisely than “strong type systems.”

Runtime checks and type evidence

Type-driven design connects domain modeling, static type systems, runtime validation, and the use of types as evidence that a property holds.

Suggested reading order:

  1. Alexis King – “Parse, don’t validate” (HTML). This is probably the closest match to the question of preserving runtime validation results in types. See Parse Dont Validate. (Lexi Lambda) Read “Parse, don’t validate”
  2. Alexis King – “Names are not type safety” (HTML). Read this immediately afterward. See Strength Of Evidence. (Lexi Lambda) Read “Names are not type safety”
  3. Scott Wlaschin – Domain Modeling Made Functional (PDF). This is the suggested book to follow Wlaschin’s article. Chapters 4-6 are especially relevant: “Understanding Types,” “Domain Modeling with Types,” and “Integrity and Consistency in the Domain.” Chapter 6 explicitly covers “Enforcing Invariants with the Type System.” (Pragmatic Bookshelf) Domain Modeling Made Functional
  4. Gabriel Volpe – Practical FP in Scala (PDF). This is the Scala book suggested as the most directly relevant to this topic. Chapter 1 has sections titled “Strongly-typed functions,” “Value classes,” “Newtypes,” “Refinement types,” and crucially “Runtime validation.” It covers Scala implementation choices for type-driven design. (Leanpub) Practical FP in Scala Some library-specific examples are from an earlier Scala ecosystem, but the design ideas transfer directly to Scala 3 opaque types.
  5. Matt Noonan – “Ghosts of Departed Proofs” (PDF). Encodes evidence of a verified precondition in types, with no runtime overhead. See Strength Of Evidence. (Input | Output) Ghosts of Departed Proofs
  6. Edwin Brady – Type-Driven Development with Idris. This takes the idea substantially further. Idris has dependent types, so properties that Scala would normally establish through runtime validation can sometimes be expressed and proven directly in types. The book covers predicates, assumptions/contracts in types, equality proofs, and state machines verified through types. (Manning Publications) Type-Driven Development with Idris
  7. Benjamin Pierce – Types and Programming Languages (TAPL) (PDF). This is the formal foundation. Pierce defines a type system as a mechanism for checking the absence of certain erroneous behaviors by classifying program expressions according to the values they can compute. (His exact wording, “a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute”, is discussed in Type Systems.) It covers type safety, abstraction, subtyping, polymorphism, recursive types, and related theory. This is suggested for understanding what the compiler can establish and how that differs from using types as an engineering technique. (MIT Press) Types and Programming Languages – MIT Press

There is also a useful conceptual bridge to formal verification: Philip Wadler’s “Propositions as Types” (PDF). It introduces the Curry-Howard correspondence: propositions correspond to types and proofs correspond to programs/values. (Informatics Homepages)

Propositions as Types – paper

Suggested path for studying runtime checks and type evidence:

Parse, don't validate
        ↓
Names are not type safety
        ↓
Domain Modeling Made Functional, ch. 4–6
        ↓
Practical FP in Scala, ch. 1  (or Production Haskell, ch. 10–11)
        ↓
Ghosts of Departed Proofs
        ↓
Type-Driven Development with Idris
        ↓
TAPL / Propositions as Types

The first four should provide a precise practical model. The later three explain why it works at a deeper level.

Type theory and refinement types

A suggested starting point for systematic study is Pierce’s Types and Programming Languages (PDF). (MIT Press) Then read Wadler’s Propositions as Types (PDF) for the logical perspective, (Edinburgh Research) and Parse, Don’t Validate (HTML) for the direct software-design consequence. (Lexi Lambda) After that, topics like refinement types, effects, linear types, and session types make much more sense.

For refinement types specifically, there are good books and courses, but surprisingly few books focus only on refinement types. Most teach them as part of type systems, dependent types, or program verification.

A path for a software engineer:

  1. Types and Programming Languages – Benjamin C. Pierce (TAPL) This is the standard foundation. It explains typing judgments, lambda calculus, type safety, subtyping, polymorphism, type reconstruction, existential types, kinds, etc. It doesn’t focus on refinement types, but it gives you the machinery needed to understand why refinement typing works. Prioritize chapters 8-11, 15-16, 22-24, 29-30 rather than reading all 600+ pages linearly. Chapter 1 is a short, readable overview of what type systems are for, and section 19.3 covers nominal versus structural typing. MIT Press: Types and Programming Languages

  2. Programming with Refinement Types – Ranjit Jhala, Eric Seidel, Niki Vazou (PDF) This is the most direct text on refinement types. It’s free and built around Liquid Haskell. It starts with logic and SMT solvers, then covers refinement types, subtyping, pre/postconditions, refined data types, measures, and real case studies. Programming with Refinement Types

  3. Niki Vazou’s Liquid Haskell course A direct course on refinement types. It goes beyond syntax and explains how checking actually works: refinement subtyping becomes logical verification conditions that are discharged by an SMT solver. It then covers data invariants, abstract refinements, termination, induction, and programs-as-proofs. The course has runnable examples, so you can experiment instead of only reading equations. Liquid Haskell course

  4. Software Foundations – Benjamin Pierce et al. Read this if TAPL makes you wonder, “Okay, but how do we actually prove that a type system is sound?” It’s an interactive textbook where the definitions and proofs are machine-checked in Rocq/Coq. Volume 2 covers operational semantics and static type systems. It teaches concepts such as the classic:

    type safety = progress + preservation

    This is one of the key ideas behind static type-system theory.

  5. Programming Language Foundations in Agda – Wadler, Kokke, Siek This is a good bridge from ordinary static types toward dependent types and theorem proving. The entire book is available online and executable in Agda. Programming Language Foundations in Agda

  6. The Little Typer – Friedman & Christiansen This is about dependent types, which are closely related to refinement types but go further. It’s much gentler than TAPL and uses the small Pie language to build intuition about propositions-as-types, equality proofs, dependent function types, etc. Best read after some practice with Liquid Haskell.

  7. Practical Foundations for Programming Languages – Robert Harper (PDF) Use this as the advanced reference after TAPL. It gives a systematic treatment of programming-language theory and is more abstract and formal. An abbreviated corrected edition is available from CMU. Practical Foundations for Programming Languages

A narrower path:

TAPL selected chapters
        ↓
Liquid Haskell course
        ↓
Programming with Refinement Types
        ↓
The Little Typer / PLFA

The first three cover most practical questions about refinement types.

A quick start: the first 2-3 chapters of Vazou’s Liquid Haskell course. It gets to actual refinement typing much faster than TAPL and explains the SMT/subtyping connection particularly well.

Library sources

  • King 2019, Parse, don’t validate – item 1 of The map; recommended in Practical type-driven design, as item 1 of Runtime checks and type evidence, and in Type theory and refinement types
  • King 2020, Names are not type safety – item 1 of The map; item 2 of Runtime checks and type evidence
  • Wlaschin 2018, Domain Modeling Made Functional – item 3 of The map; the main recommendation in Practical type-driven design, and item 3 of Runtime checks and type evidence
  • Vernon 2016, Domain-Driven Design Distilled – chapters 2, 4 and 5 on bounded contexts, context mapping and aggregates; item 3 of The map
  • Khononov 2021, Learning Domain-Driven Design – chapters 3-4, 6-7 and 9 on bounded contexts, context mapping, value objects, aggregates, event sourcing and sagas; item 3 of The map
  • Schwarz 2020, Scala 3 by Example: ADTs for DDD, Part 1 – slides that follow Domain Modeling Made Functional, with Wlaschin’s F# beside the Scala 3 version; the Scala track of The map and the DMMF entry in Practical type-driven design
  • Płachta 2022, Grokking Functional Programming – chapter 7, “Requirements as types”; the Scala track of The map
  • Volpe 2021, Practical FP in Scala, 2nd Edition – chapter 1, and chapter 2 on tagless final; the Scala track and item 6 of The map, and item 4 of Runtime checks and type evidence
  • Volpe 2023, Functional Event-Driven Architecture: Powered by Scala 3 – chapter 4, newtypes on opaque types and Iron; the Scala track of The map
  • Odersky et al. 2021, Programming in Scala, 5th Edition – section 17.4 and chapter 20; the Scala track of The map
  • Wampler 2021, Programming Scala, 3rd Edition – chapters 9, 16 and 17; the Scala track of The map
  • De Goes et al. 2025, Zionomicon – appendices 1 and 2 on the Scala type system (union and intersection types, Any and Nothing) and variance; the Scala track of The map
  • Kurt 2018, Get Programming with Haskell – lessons 12-13 (data, type synonyms and type classes), the unit 3 opener on programming in types, and lesson 16, “Creating types with ‘and’ and ‘or’”; the Haskell track of The map
  • Allen et al. 2016, Haskell Programming from First Principles – chapters 11 and 12; the Haskell track of The map
  • Skinner 2023, Effective Haskell – chapter 4, “Creating Type Aliases” (how an alias gives up the protection a new type gives), and chapter 5, “Choosing What to Export” (smart constructors, phantom types and export lists); the Haskell track of The map
  • Parsons 2023, Production Haskell – chapters 5-7 (“Three Layer Haskell Cake” and decomposing effects), chapters 10-12 (“Type Safety Back and Forth”, “Keep Your Types Small…”, “The Trouble with Typed Errors”), chapter 15 (“Growing Pains”) and chapters 20-22 (type-level programming and its trade-offs); the Haskell track, item 6 and item 13 of The map, and Runtime checks and type evidence
  • Bloch 2018, Effective Java, 3rd Edition – the Java track of The map
  • Urma et al. 2018, Modern Java in Action – chapter 11, “Using Optional as a better alternative to null”; the Java track of The map
  • Pilquist et al. 2023, Functional Programming in Scala, 2nd Edition – sections 4.4.1-4.4.2 and 12.4.1 on accumulating errors and Validated; item 5 of The map
  • Welsh et al. 2020, Scala with Cats – chapter 10, “Case Study: Data Validation”; item 5 of The map
  • Ghosh 2017, Functional and Reactive Domain Modeling – chapters 3-5 and 10; item 6 of The map
  • Granin 2025, Functional Design and Architecture – chapter 13 on interfaces and wiring; item 6 of The map
  • Noonan 2018, Ghosts of Departed Proofs (Functional Pearl) (doi:10.1145/3242744.3242755) – item 7 of The map; item 5 of Runtime checks and type evidence
  • Kleppmann et al. 2026, Designing Data-Intensive Applications, 2nd Edition – chapter 5, “Encoding and Evolution”; item 8 of The map
  • Helland 2005, Data on the Outside versus Data on the Inside – encapsulated inside data versus unlocked, versioned outside messages; item 8 of The map
  • Krishnamurthi 2025, Programming Languages: Application and Interpretation, version 3 – “Safety and Soundness”, “Type Inference” and “Gradual Typing”; item 9 of The map
  • Scott et al. 2025, Programming Language Pragmatics, 5th Edition – chapter 7, “Type Systems”; item 9 of The map
  • Pierce 2002, Types and Programming Languages – item 10 of The map; item 7 of Runtime checks and type evidence and item 1 of Type theory and refinement types
  • Wadler 2015, Propositions as Types – item 11 of The map; the bridge to formal verification in Runtime checks and type evidence, and an early step in Type theory and refinement types
  • Jhala et al. 2020, Programming with Refinement Types: An Introduction to LiquidHaskell – item 12 of The map; item 2 of Type theory and refinement types
  • Rondon et al. 2008, Liquid Types – item 12 of The map
  • Maguire 2018, Thinking with Types: Type-Level Programming in Haskell – chapter 15, “Dependent Types”, with the chapters on the features it names as prerequisites (2 on data kinds and type families, 5 on GADTs, 6 on rank-N types), and section 1.4 on the Curry-Howard isomorphism; item 13 of The map
  • Hackett 2020, Review of “Thinking with Types” (doi:10.1017/S0956796820000015) – JFP review separating cardinal arithmetic from Curry-Howard and noting the codensity versus Cont distinction; item 13 of The map
  • Bragilevsky 2021, Haskell in Depth – chapters 11 and 13; item 13 of The map
  • Harper 2016, Practical Foundations for Programming Languages, 2nd Edition – item 14 of The map; item 7 of Type theory and refinement types