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

What to Use Instead of Imperative Code

Imperative Pattern Effect Replacement
Simple if/else (no nesting) Allowed as-is
else if chains Match.value + Match.when
Related skills

More from andrueandersoncs/claude-skill-effect-ts

Installs
2
GitHub Stars
8
First Seen
Mar 22, 2026