A Rust-centric explanation of the 'Parse, don't Validate' pattern and type-driven design. Using examples like NonZeroF32 and NonEmptyVec newtypes, the post demonstrates how encoding invariants into types at compile time is superior to runtime validation. Key ideas include making illegal states unrepresentable, pushing
Table of contents
Table of ContentsDividing by zero #Examples in the wild #Maxims of Type Driven Design #What can we do? #Conclusion #Sort: