~/talk

Far More Than You’ve Ever Wanted To Know About Adts

Talkat Scala Italy 2023 · on Saturday, 2023-11-11· [scala, compilers-and-language-design]
slides:none on file

Starts from a buggy int-based Direction enum, shows why Scala's built-in enumerations disable pattern-match exhaustivity, implements hand-rolled sealed ADTs, and builds a recursive Command type with Chain to compose actions. Then adds phantom types Idle/Moving and turns Command into a GADT that encodes before/after states, so the compiler forbids invalid sequences (e.g., start when already moving). Demonstrates algebraic reasoning (list size n has |A|^n possibilities, Boolean lists ≤2 produce 7 values) and shows the implementation compiles and enforces safety.

AI-written summary · about

  1. 0:00Introduction to data modeling
  2. 1:50Why Gundams and examples
  3. 4:16Early mistakes with directions
  4. 6:46Problems with Scala enumerations
  5. 8:52Sealed types for safety
  6. 11:39Key takeaways so far
  7. 12:23Case classes and commands
  8. 15:53Defining algebraic data types
  9. 19:25Sum types and product types
  10. 23:37Scala 3 enums and ADTs
  11. 25:23Command composition issues
  12. 26:27State transitions with types
  13. 30:19Generalized algebraic data types
  14. 31:21Defining GADTs
  15. 33:50Why call them algebraic data types
  16. 36:19Cardinality and isomorphisms
  17. 42:00Recursive data types
  18. 45:30Algebraic properties of ADTs
  19. 46:12Summary and closing
~/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.