#discriminated-union Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
TypeScript Discriminated Unions with Exhaustive Switch
Discriminated (tagged) unions give you compiler-checked state machines. Pair with `assertNever` to force every new variant to be handled at every switch site — refactors stop being scary.