~/talk

Type-Classes (in Scala 3)

Talkat Scalar 2026 · 2026-03-26..03-27· [scala]
slides:none on file

Scala 3 treats type classes as an officially supported pattern with givens and extension methods, opaque types and mirrors and saner macros for automatic derivation. The compiler proves constraints so the CanEqual multiversal equality enforces type-safe comparisons unless an instance is supplied. Implicit scope still finds instances in companions (put instances in the right roots) and Scala 3.7 flips prioritization so supertypes win over subtypes, avoiding many conflicts. Example: a working JSON codec is generated in about one hour using derivation and it works.

AI-written summary · about

  1. 0:00Introduction
  2. 1:51Object-oriented programming in Scala
  3. 4:41Subtyping limitations
  4. 6:05Type classes in Scala 2
  5. 8:35Type classes in Scala 3
  6. 11:28Type classes vs OOP
  7. 13:13Multiversal equality
  8. 16:04Type classes and proving
  9. 18:52Design challenges
  10. 21:24Implicit scope rules
  11. 22:30Given prioritization in 3.7
  12. 25:40Avoiding inheritance
  13. 27:51Macros and derivation
  14. 29:39Compile-time vs reflection
~/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.