~/talk

Polymorphic Function Types in Scala 3

slides:none on file

Explains concrete Scala 3 changes: adds polymorphic function types that require a polymorphic apply method, implemented as a refinement trait and compiled by erasure that erases to FunctionN (uses FunctionXXL for >22 args) with casts inserted. Shows real uses: Tuple.map preserving element types, Shapeless generic folds for typeclass derivation, type-level sized lists and a Cats Effect example for a safe compute callback. Covers compiler work, SIP-49 experimental status, and proposed ergonomics like type-parameter closure and improved subtyping.

AI-written summary · about

  1. 0:00Intro
  2. 3:15Method references
  3. 6:49Example usecase
  4. 10:49Taking a step back
  5. 13:29Type erasure (2/2)
  6. 19:30Example 2: Preserving type information
  7. 25:21Encapsulation
  8. 29:33Polymorphic eta-expansion (1/2)
  9. 34:38Idea 2: type parameter clause inference + eta-expansion
  10. 36:43Better subtyping
~/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.