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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.