Effective Match Types
summary
Match types power Scala 3 features like generic tuples, named tuple extraction for route parameters and structural types, and type class derivation, while the compiler’s disjointness checking forces rules: avoid open traits or abstract types as patterns, prefer final/sealed classes, and expect no nested invariant bindings. Built‑ins in scala.compiletime.ops and tuple ops enable parsing, recursion and materializing values; benchmarks show match types beat implicits (50 vs 100‑element HList benchmark), but large recursions need bigger stack and lack a tail‑rec optimization.
AI-written summary · about
chapters (14)
- 0:00Effective match types
- 1:05Match types in Scala
- 3:34Match types vs dynamic/static
- 4:59Demo: HTTP routing
- 9:15Defining match types
- 12:52Disjointness checking
- 17:32Rules and limitations
- 23:36Built-in match types
- 25:45Performance and complexity
- 29:09Real-world applications
- 33:21Refine types and use cases
- 37:17Challenges and future
- 40:07Troubleshooting stack size
- 40:32Q&A
related talks
49mType level Programming in Scala
46mEverything You Always Wanted to Know About Pattern Matching
31mGoing structural with Named Tuples
42mPolymorphic Function Types in Scala 3
32mUnderstanding the Type System of Scala 3
40mPolymorphic Function Types in Scala 3
19mLogically Qualified Types for Scala 3
31mType-Classes (in Scala 3)
