~/talk

TYPE CLASSES FROM THE GROUND UP

Talkat Scalar 2020 · on Friday, 2020-05-15· [scala, functional-programming]
slides:none on file

Builds a CSV parser then a decoding library that turns rows of strings into business types by defining CellDecoder and RowDecoder type classes and registering instances as implicits. Shows how implicit resolution composes instances (lists, options, either, tuples) to decode nested and mixed columns automatically, demonstrates the implicit-conversion pitfall, reproduces the same pattern in Java with explicit dictionaries, previews nicer Scala 3 extension syntax, and challenges the Haskell uniqueness claim with a counterexample that still compiles and produces duplicated set entries.

AI-written summary · about

  1. 0:00Intro
  2. 1:23CSV data
  3. 1:34Parsing CSV
  4. 2:20Decoding to Int
  5. 3:45Generic decoding
  6. 5:24Decoding with implicits
  7. 6:08The dangers of implicits
  8. 8:12Implicit decoder
  9. 10:23Subclassing
  10. 12:14Explicit dictionary
  11. 13:29Key takeaways
  12. 14:02Heterogenous types
  13. 14:38RowDecoder type class
  14. 15:32(Int, String) decoder
  15. 16:37Implicit resolution revisited
  16. 17:54(A, B) decoder
  17. 18:48Collections of values
  18. 19:43Optional cells
  19. 20:56Cells with multiple types
  20. 22:10Going nuts
  21. 23:57Context bounds
  22. 24:47Instance summoning
  23. 26:13Scala 3 extension methods
  24. 27:14If you only remember 1 slide...
  25. 29:58Global uniqueness
~/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.