Pragmatic Type-Level Design (PTLD E-Book)
Pragmatic Type-Level Design
Practical introduction into type-level programming: design principles, design patterns, methodologies, approaches
About the Book
Pragmatic Type-Level Design is a book about programming in types, about the discipline of Software Design, lifted onto the level of types, and type-level approaches useful in real practice.
This is my second fundamental book about Software Design, in addition to Functional Design and Architecture.
I aim to provide a well-written and well-structured source of knowledge about type-level design. I’m not only talking about type-level features but also providing a reasoning framework for making the narrative complete and comprehensive. The central philosophy of this book - pragmatism - is used to build a practice-first methodology on how to approach types and not drown in the related complexity. The type-level design is difficult on its own, type-level features in various languages are difficult as well, and there is no need to raise the learning bar even more.
The book will be useful for developers who want to start doing real things on the type level.
If you liked my FDaA book, you’ll find PTLD enlightening and insightful as well.
Book completion estimation: end of 2025
Book topics:
type-level design
type-level eDSLs
correctness
complexity of solutions
Inversion of Control and Dependency Injection
domain modeling
type-level functional interfaces
design of business logic
interaction with impure subsystems
application architectures & design patterns
testing
GitHub repo: Pragmatic-Type-Level-Design
Table of Contents
- Part I The basics of type-level software design
- 1 Emergent type-level design
- 1.1 Approaching the type-level design
- 1.1.1 Types and values
- 1.1.2 Pragmatic Type-Level Design
- 1.1.3 Typed Forms diagrams
- 1.2 The foreshadowing of type-level design
- 1.2.1 Basics of generics
- 1.2.2 Basics of type classes
- 1.2.3 Design principles
- 1.2.3 Basics of type-level literals
- 1.3 Summary
- 1.1 Approaching the type-level design
- 2 Use case: simple extensibility
- 2.1 Extensibility
- 2.1.1 Extensibility mechanisms
- 2.1.2 Extensibility requirement
- 2.1.3 Extension points
- 2.2 Basically extensible application
- 2.2.1 Type class interface
- 2.2.2 Heterogeneous storage problem
- 2.2.3 Valuefication and existentification
- 2.2.4 Valuefied storage
- 2.2.5 Existentified storage
- 2.3 Summary
- 2.1 Extensibility
- 3 Use case: genericity and customization
- 3.1 Type-level genericity
- 3.1.1 Empty ADTs
- 3.1.2 Type applications
- 3.1.3 Ordinary and specific kinds
- 3.1.4 Custom type-level ADTs and kinds
- 3.1.5 Type-level lists
- 3.2 Type-level customization
- 3.2.1 Case-driven design methodology
- 3.2.2 Customizable type-level eDSL
- 3.3 Summary
- 3.1 Type-level genericity
- 4 Use case: enforcing correctness
- 4.1 Correctness is about meaning
- 4.1.1 Type-safe vs correct
- 4.1.2 Type-level vs correct
- 4.2 Static referential integrity
- 4.2.1 Strengthening the domain model
- 4.2.2 Static and volatile domain notions
- 4.2.3 Static operational integrity
- 4.2.4 Type-level validators
- 4.2.5 Static structural integrity
- 4.3 Summary
- 4.1 Correctness is about meaning
- 1 Emergent type-level design
- Part II High-level application design
- Part III Advanced type-level design
- Part IV Rosetta Stone
- Appendices
- Appendix D The Mythologized Correctness
- D.1 Type safety
- D.1.1 Generic type safety
- D.1.2 Descriptive type safety
- D.2 Technical correctness
- D.2.1 Correctness of data structures and algorithms
- D.2.2 Correctness of data models
- D.2.3 Correctness of languages
- D.2.4 Conclusion
- D.1 Type safety
- Appendix D The Mythologized Correctness
Other books by this author
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them