Memory cards
Types are a proof the compiler can check
confidence: mediumupdated: 2026-11-25status: activeengineeringtypescompiler
Claim#
Sum types, variance and exhaustiveness remove whole classes of invalid state.
Test#
Model the state as a sum type. Make illegal states unrepresentable. Add an exhaustive match.
Proof#
A compiler error on the missing case.
Failure modes#
A cast or any type can erase the proof. Runtime data still needs validation.