Purely Dysfunctional Data Structures
summary
Explains why efficient immutable collections need structural sharing rather than naive copying, shows concrete pitfalls (String substring and ArrayList subList share backing arrays and cause surprises), describes persistent linked lists, the two-list (banker) queue and its amortized costs, and the Hash Array Mapped Trie (wide branching like 32 yields ~6–7 hops even for huge maps). Notes immutability doesn’t remove concurrency work, costs more memory but benefits from GC, and recommends the Vavr library as a practical Java option.
AI-written summary · about
chapters (19)
- 0:00Introduction to immutability
- 2:41Problems with mutable abstractions
- 5:55Benefits of immutability
- 7:44Definition of immutable objects
- 10:35Practical immutability limits
- 12:04Designing immutable APIs
- 15:14Persistent data structures
- 17:44Real-world immutability challenges
- 21:57Immutable linked list basics
- 24:22Thread safety with immutable data
- 26:50Concurrency trade-offs
- 28:39Immutable set implementation
- 31:15Persistent queue solutions
- 33:41Performance of persistent queues
- 36:13Cache efficiency in data structures
- 38:41Persistent hash map attempts
- 43:36Complexity of immutability
- 44:39Key takeaways and libraries
- 46:05Conclusion and resources
related talks
48mPurely Functional Data Structures
48mFunctional data structures in Java
48mPurely functional data structures demystified
01h 00mImmutable Data with Java: Using Immutable Data Structures
42mPure Functions and Immutable Objects
02h 27mEscape from the Planet of the Collections
34mFunctional Programming Anti-Patterns in Java
01h 01mFunctional C++
