LIFTING DATA STRUCTURES TO THE TYPE-LEVEL
summary
Shows how value-level List/Set/Map lift to type-level equivalents (HList, HSet, HMap) and proves it’s practical: uses implicit-based type classes for contains on HLists, uses intersection types plus a contravariant wrapper to model HSet with deduplication, wraps elements in an invariant HLN to avoid unwanted subtyping, and uses Scala unification and singleton types to implement HMap and DAG references. Compiler prevents invalid forward/cyclic references; implicit search can be slow but the constructions compile and work.
AI-written summary · about
chapters (6)
- 0:00Start
- 2:38Recursive Function
- 9:40Intersection Types
- 16:39Type Alias
- 25:22Directed Acyclic Graphs
- 28:06Compile Error
related talks
45mTypelevel Programming 101: The Subspace of Scala
24mLet the Scala compiler work for you
01h 02mPrinciples and tools to cleverly model your data in Scala
49mRoll Your Own Shapeless
39mExtreme Cleverness: Functional Data Structures in Scala
48mAcademese to English: A Practical Tour of Scala’s Type System
39mA few tips on modelling things in Scala
49mType level Programming in Scala
