Type Driven Design

Make illegal states unrepresentable — enums instead of boolean and string flags, newtypes instead of bare primitives, parsed types instead of validated ones, typestate for protocol order. Use when a struct has fields that are only valid in some combinations, when validation is re-checked at many call sites, when boolean flags multiply, or when the user asks how to model a domain in Rust.

rewrite-rs Updated 18 repo stars

File contents

rewrite-rs/skills commit 8ed8f92028

Frequently asked questions

npx get-skill add rewrite-rs/type-driven-design