First-class Dynamic Types
summary
Claim: patterns in Grace become first-class type objects that are looked up at runtime, matched via a uniform match API, and can carry transformed values back into callsites. Implementation uses the existing Grace pattern/match engine, reflection for structural tests, metadata brand-based tagging for nominal distinctions, and library patterns for ranges, enums, dependent constraints, decorators and invariants. Code is implemented as a simple lookup-and-match translation in the interpreter and demonstrably accepts, rejects, or coerces values at call and return points.
AI-written summary · about
