The Shape of Shapeless (Part 2)
summary
Walks through concrete techniques to derive code with Shapeless: defines a lexicographic compareHList, exposes output types with the ox pattern (refinement aliases), uses Scala implicits and HLists to derive an Ordering for case classes (Point2D example) and for recursive binary trees, and shows when derivation diverges and how lazy boxes break recursive implicit loops. Demonstrates working derivation, lists where it fails, and the specific fixes and tradeoffs (macros for generic instances, runtime/compile fragility).
AI-written summary · about
chapters (11)
- 0:00Start
- 3:49Implicit Resolution
- 8:07Refinement Types
- 8:46Refinement Test
- 11:02Ox Pattern
- 19:43Exercises
- 20:40Generic Programming
- 21:462d Binary Trees
- 26:54Co-Product
- 37:09Implicit Cases
- 51:46The Value of Shapeless
related talks
54mRoll Your Own Shapeless
46mAutomatic type class instance derivation with shapeless
36mShapeless all the things !!
48mA gentle introduction to type level programming in Scala
44mType level Computations in Scala
57mKittens: Shapeless Typeclass Derivation for Cats
22mTransformation Function Called Higher-Order
44mTelling the Truth with Types
