Pragmatic-Type-Level-Design
April 9, 2025 ยท View on GitHub
Code and materials for my advanced book Pragmatic Type Level Design
Pragmatic Type-Level Design is a deep book that explores practical concepts of type-level design in various statically typed functional and object-oriented languages, especially Haskell, F#, OCaml, Rust, C++, and Scala.
Unlike most resources that focus on the mathematical underpinnings of type-level programming, this book's primary emphasis lies in pragmatism: it explores the practical application of these concepts in actual programming scenarios. It formulates best practices, examines how types influence application design and architecture, and outlines principles for managing the inherent complexity in type-level code.
Haskell is a model language, but the book contains the Rosetta Stone part with the ideas translated into Scala 3 and Rust.
Topics:
๐ค type-level domain modeling
๐ต type-level domain-specific languages (eDSLs)
๐ฃ type-level correctness verification
๐ก extensibility and genericity approaches
๐ type-level interfaces (my own concept)
๐ด application architectures and type-level design patterns
๐ข design principles such as SOLID, make invalid states unrepresentable, dumb but uniform
โช๏ธ a whole methodology called Pragmatic Type-Level Design
Pragmatic Type-Level Design best works in pair with Functional Design and Architecture (early self-published edition, and a new one with Manning Publications). FDaA is a fundamental book on software design in functional languages.
Both FDaA and PTLD provide a consistent, pragmatic, and structured set of knowledge never seen before in the functional world.
Buy both and learn a lot of great ideas presented in an academism-free, mature style. You'll likely won't find anything better than my books anywhere else in the field.


