Shapeless? - Easy!
summary
Shapeless is a Scala generic programming library with about 70 contributors and ~40,000 lines that turns case classes into HList representations via Generic so you can write type-driven algorithms like a compile-time size counter. The demo builds a Delta diff algebra that compares nested fields (addresses inside person) with low-priority implicits to prefer structural generics over primitives, and a Patcher that applies a Delta to produce an updated instance — it compiles and runs.
AI-written summary · about
chapters (14)
- 0:00Shapeless and generic programming
- 1:13Generic programming benefits
- 2:39HLists in Shapeless
- 4:27HList manipulation with type classes
- 6:38Live demo counting HList elements
- 9:16Case class ↔ HList conversion
- 10:44Generic programming use case
- 12:11Delta type for comparisons
- 16:30Delta type class implementation
- 17:12Live demo: comparing case classes
- 18:39Nested comparisons with Delta
- 23:35Other Shapeless features
- 25:00Applying Deltas to modify objects
- 27:37Q&A
related talks
49mRoll Your Own Shapeless
23mPlaying with Shapeless
01h 01mThe Shape(less) of Type Class Derivation in Scala 3
43mAdventures in Metaprogramming: Macros versus Shapeless
24mLet the Scala compiler work for you
35mRandom Data Generation With Scalacheck
26mShapeless Party Tricks in the Enterprise
29mADVENTURES IN META-PROGRAMMING
