pattern-matching
Installation
SKILL.md
Effect Pattern Matching Skill
Use this skill when working with discriminated unions, ADTs, conditional logic, or any type that uses _tag discrimination. Pattern matching provides exhaustive, type-safe alternatives to imperative conditionals.
Core Philosophy
Pattern matching over imperative conditionals:
- Exhaustive by default (compiler enforces all cases)
- Type-safe refinement in each branch
- Declarative, not imperative
- Pipeline-friendly composition
Pattern 1: Data.TaggedEnum for ADTs
Use Data.TaggedEnum instead of manual tagged unions.