~/talk

The diamond of variance

Talkat try! Swift Tokyo 2018 · 2018-03-01..03-03· [typescript]
slides:none on file

Argues that Swift's generics map onto a four-point "diamond of variance" and walks through concrete Swift code snippets showing covariance, contravariance, invariance, phantom as distinct cases. Demonstrates Optionals and closures as examples (optionals behaving like covariance, function parameters like contravariance), and shows tiny toy types where an unused generic parameter produces a phantom type. Claim: these examples expose how Swift's type system fits the theory rather than just language folklore.

AI-written summary · about

  1. 0:00Introduction
  2. 0:48Understanding covariance
  3. 1:25Covariance in practice
  4. 2:20Contravariance explained
  5. 3:22Invariance and phantom types
  6. 4:21Recap and conclusion
~/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.