~/talk

Keep Your Types Small

Talkat Scala Love 2022 · on Friday, 2022-02-18· [software-architecture]
links:none on file
slides:none on file

Walks through the validator code from a Medium article and shows concrete design choices that shrink program space by counting type cardinalities, turning a search from about 10^16 to 283 possible validators. Uses Scala algebraic data types, enums, generics, type classes and libraries like Cats and SyncIO, plus optics and recursion schemes, to argue for smaller domain types, fewer sums in parameter position, and how parametric polymorphism can make many functions unique.

AI-written summary · about

  1. 0:00Introduction to small types
  2. 2:50Measuring type size
  3. 5:48Algebraic data types explained
  4. 8:22Shrinking program cardinality
  5. 10:31Prefer enums over classes
  6. 12:18Avoid sums in parameters
  7. 15:30Tools for cardinality analysis
  8. 16:56Generics reduce complexity
  9. 18:23Reusing common algebras
  10. 20:07Domain types shrinking
  11. 21:32Avoid general parameters
  12. 22:13Property-based testing benefits
  13. 22:35Optics and recursion schemes
  14. 23:16References and conclusion
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.