Simplifying Scala Collections
summary
Prototype Collections family that captures an equality type class and produces case-insensitive sets and whitespace-insensitive sets without wrapper types, so unions/intersections fail to compile if equalities differ. Implements covariant extensional sets plus contravariant intentional “membership” sets, lazy transformation views and a forceInto to materialize into a chosen equality family. Adds inhabited sets (nonempty types), a sensible default Any equality, and reduced inheritance. Work-in-progress repo code compiles and behaves as described; experiments show the design is practical and migratable, not just theoretical.
AI-written summary · about
chapters (22)
- 0:00Intro
- 1:26Standard Collections Library
- 1:40Binary Compatibility
- 4:12Equality
- 4:29Case insensitive strings
- 6:01Wis
- 6:18Whitespace Sensitive Strings
- 8:09Type class coherence
- 9:05Type class equality
- 9:53Type less coherence
- 10:06Type classes vs the world
- 21:04Scala Sets
- 28:11Extensional Collections
- 29:15Contravariant Collections
- 38:27Seek View
- 39:29Set View
- 40:37Add Inheritance
- 40:50demo
- 42:27downside
- 42:47bugs and duplication
- 43:53test matrix
- 44:52benefit of type class coherence
related talks
01h 04mKeynote - What to Leave Implicit
50mPrinciples of Elegance
17mContextual Equality Saturation
14mMath Behind Software
18mDeclarative Data Collections for Portable Parallelism
25mImmutable APIs and mutable internals: a Scala design case study
37mWhen is an ADT not an ADT?
30megg: Fast and Extensible Equality Saturation
