~/talk

TYPECLASSES — A TYPE SYSTEM CONSTRUCT

Talkat Scalar Conference 2017 · 2017-04-07..04-08· [scala]
slides:none on file

Typeclasses provide ad hoc polymorphism in Scala but are implemented via implicits, which creates surprises: orphan instances roam globally, implicit search picks the most specific available and can cause ambiguity, and overlapping instances break coherence and move-code semantics. Lessons from Haskell and Rust lead to concrete fixes: put instances in companion objects or a dedicated orphan package, use wrapper types for alternative semantics, and use Simulacrum/Cats (macros that generate ops and syntax) to reduce boilerplate and improve discoverability.

AI-written summary · about

  1. 0:00Introduction
  2. 1:24Supporthoc polymorphism
  3. 4:08Defining the type class
  4. 7:50Type class definition
  5. 12:17Type class implementation
  6. 12:38Orphan instances
  7. 14:17Rust
  8. 16:20Implicit Resolution
  9. 17:47Issues with Type
  10. 23:26Simulacrum
  11. 27:04Cat
  12. 28:20Orphans
  13. 28:43OK
  14. 29:40Maintainability Readability
  15. 29:59Summary
~/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.