Functional Data Structures
summary
Compares four Elm binary-tree implementations and concludes Elm’s union types produce the clearest code. Starts with an array-based layout using child indices 2i+1 and 2i+2 and shows the waste of using Maybe to mark empty slots. Switches to core Dict to avoid filler, then to record-based pointers (recursive type required) with full insert and remove, and finally to a compact union-node type. Builds working insert and remove for pointer versions and shows the union-node is simplest and most readable.
AI-written summary · about
chapters (6)
- 0:00Introduction to talk
- 1:37Array-based approach
- 5:14Dict-based approach
- 6:18Pointer-based approach
- 7:43Simplified node structure
- 9:12Comparison and summary
related talks
01h 32mAlgorithms for Trees - Foldable, Applicative, Traversable
47mPurely Dysfunctional Data Structures
14mThe Extensibility Problem
29mRepresenting Data Structures with Invariants in Haskell: the cases of BST and AVL
48mPurely Functional Data Structures
32mFunctional implementation of Finger Trees in JavaScript
48mFunctional data structures in Java
48mPurely functional data structures demystified
