Type-Driven Design with Swift
With this series of articles I have a lofty goal of shifting your Swift programming mindset. I know, sounds presumptuous, but this is exactly what happened to me a few years back when I was introduced to Type-Driven Design. I assure you, it’s not some new fad or an esoteric methodology. It’s a system of practical, well-researched, and time-tested ideas that form the basis for the powerful approach to writing a high-quality, robust, and correct code.
Principles of Type-Driven Design are widely discussed in various functional programming communities, but are yet to receive a significant attention from the mainstream Swift community. The good news is that many Swift codebases already lean heavily on these principles. And I bet, you are already familiar with many of them. But there’s a tremendous value in structuring fragmented knowledge into a cohesive system, that's when you gain truly deep insights.
So take a cup of coffee, and let’s dive in!
📖 Table of Contents:
Part 1
Fundamentals of type-driven code
Part 2
Type-safe validation
Part 3
Witness pattern — type-safe access control
Part 4
Domain modeling with types
Part 5
Making illegal states unrepresentable
Part 6
Coming soon
Managing side effects
Part 7
Coming soon
Falling into the Pit of Success
Part 8
Coming soon
Fatal error as a design tool
Part 9
Coming soon
Types are Tests