~/talk

Generics in protocol extensions

TalkinJapaneseat try! Swift Tokyo 2019 · 2019-03-21..03-22· [swift]

Shows a Swift technique for building a heterogeneous list and implementing HList append using protocol extensions without true generics. Uses successive wrapper types (App1, App3, App5) and an "ev" witness type to force associated types to concrete types; the proof-of-concept compiles and runs but needs many explicit type annotations because Swift’s type inference cannot pick the ev results, so the author finds it fragile for production.

AI-written summary · about

  1. 0:00Introduction
  2. 1:55Tuples and lists
  3. 4:34Heterogeneous lists
  4. 7:13Protocol basics
  5. 9:30Protocol extensions
  6. 11:41List append
  7. 13:22Heterogeneous append
  8. 17:50Type inference limits
  9. 18:56Summary
~/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.