types-as-sets
Installation
SKILL.md
Think of Types as Sets of Values
Overview
A type is a set of possible values. Assignability means subset.
Understanding types as sets helps you reason about unions, intersections, extends, and never. This mental model makes TypeScript's behavior intuitive.
When to Use This Skill
- Confused why
A & Bhas MORE properties thanAorB - Don't understand why
extendsmeans "subset" - Reasoning about union and intersection types
- Working with
neverorunknowntypes - Debugging "not assignable to" errors