Kittens: Shapeless Typeclass Derivation for Cats
summary
Claims automatic derivation of Cats typeclasses (Functor, Foldable and friends) for ADTs with no handwritten instances by combining kittens with shapeless generics, relying on a small stack of helpers including export-hook and macro-compat. Implements higher‑kinded derivation by turning type-level computation into a continuation‑passing style to work around SI‑2712, collapses product and coproduct handling into one operator, and successfully derives Functor for a polymorphic Tree in a live demo (builds require rapidly changing snapshot dependencies).
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:03Deriving typeclass instances
- 2:04Why Kittens and Shapeless
- 12:37Lawless typeclasses in Cats
- 16:52Implicit scope challenges
- 22:59Demo: Higher-kinded derivation
- 34:02Type-level continuation passing
- 42:31Unifying products and coproducts
- 49:57Live demo of Kittens
- 51:30Conclusion
related talks
36mKittens - datatype-generic functional programming with Scala
01h 01mThe Shape(less) of Type Class Derivation in Scala 3
46mAutomatic type class instance derivation with shapeless
56mThe Shape of Shapeless (Part 1)
18mDiscovering Types (from Strings) with Cats and Shapeless
28mAdopting Cats
32mRecursion schemes with Higherkindness
31mTYPECLASSES — A TYPE SYSTEM CONSTRUCT
