pattern-matching
Installation
SKILL.md
Pattern Matching in Effect
Overview
Pattern matching replaces complex control flow in Effect code. Simple if/else (no nesting, no else if) is allowed, but else if chains, nested conditionals, and ternary operators must use pattern matching.
Effect's Match module provides:
- Exhaustive matching - Compiler ensures all cases handled
- Type narrowing - Automatic type inference in each branch
- Composable matchers - Build complex patterns from simple ones
- Predicate support - Match on conditions, not just values