~/talk

Everything You Always Wanted to Know About Pattern Matching

Talkat Scala Days Berlin 2016 · 2016-06-15..06-17· [scala]
slides:none on file

Explains how Scala pattern matching works under the hood: extractor objects use unapply/unapplySeq and may return a boolean, an Option[T], an Option[(T1,T2)], or any object with isEmpty/get and _1/_2, which the compiler treats accordingly; the match phase inserts instance checks and builds a decision tree and can be inspected with -Xprint:patmat. Notes performance (allocations, name‑based extractors in Scala 2.11) and surprising facts: case classes can exceed the 22-field limit because pattern matching accesses fields directly; regex and string‑context extractors and @switch are intent annotations.

AI-written summary · about

  1. 0:00Introduction
  2. 2:48Constant Pattern
  3. 4:23Common Mistakes
  4. 12:33Metric
  5. 13:08Minutes Hours
  6. 13:33Pattern Matching
  7. 15:18Plus It Takes
  8. 16:53Apply
  9. 24:03Double colon
  10. 25:28Plus colon
  11. 27:53Pattern match
  12. 29:48Case classes
  13. 30:38Companion objects
  14. 32:43Using fields directly
  15. 34:23Using variables
  16. 39:48Lookups
  17. 42:33Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.