8 Functional data structures
This chapter covers
- Understanding the omnipresence of linked lists in FP languages
- Data sharing in functional data structures
- Working with trie structures
- Comparing a standard vector to its immutable counterpart
So far, I’ve talked mostly about higher-level functional programming concepts, and we spent quite a while examining the benefits of programming without mutable state. The problem is that programs tend to have many moving parts. While discussing purity in chapter 5, I said one of the options is to have only the main component with mutable state. All other components are pure and calculate a series of changes that should be performed on the main component, but without actually changing anything. Then ...
Get Functional Programming in C++ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.