cekrem.github.io
Making Impossible States Impossible: Type-Safe Domain Modeling with Functional Dependency Injection
Most applications don’t fail because algorithms are hard—they fail because our models allow states that make no sense in the domain. “User without email but verified”, “order that’s both shipped and cancelled”, “sum < 0”, “modal dialog both closed and active”. These states should be impossible from the start.