Purely Functional Data Structures
Table of Contents
- 1. Background
- 2. Code
- 3. Implementation
- 3.1. Pair
- 3.2. Node
- 3.3. LinkedList
- 3.4. List
- 3.5. Association List
- 3.6. Map
- 3.7. Object
- 3.8. Set
- 3.9. Sequence
- 3.10. Collection
- 3.11. Stack
- 3.12. Record
- 3.13. Queue
- 3.14. Binary Search Tree
- 3.15. Trie
- 3.16. Persistent List
- 3.17. Persistent Binary Search Tree
- 3.18. Leftist Heaps
- 3.19. Binomial Heaps
- 3.20. Splay Heaps
- 3.21. Red-Black Trees
- 4. Examples
- 5. API
1. Background
Implement persistent data structures with limited use of host data structures (other than function definition and simple data types).
This works off of Okasaki's "Purely Functional Data Structures" and Immutable.js.
3. Implementation
3.1. Pair
3.2. Node
3.3. LinkedList
3.4. List
3.5. Association List
3.6. Map
3.7. Object
3.8. Set
3.9. Sequence
3.10. Collection
3.11. Stack
3.12. Record
3.13. Queue
3.14. Binary Search Tree
3.15. Trie
3.16. Persistent List
3.18. Leftist Heaps
3.19. Binomial Heaps
3.20. Splay Heaps
3.21. Red-Black Trees
4. Examples
5. API
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L49
- first
- next
- rest
- second
- ffirst
- nfirst
- fnext