Pure functional data structure
A pure functional data structure is immutable: operations produce new versions while preserving existing ones.
Functional Programming in Scala, Second Edition
A purely functional data structure is an immutable data structure whose operations produce new values without mutating existing ones.
- How it is used
- Uses immutable lists to demonstrate pure operations, recursive processing, pattern matching, and data sharing.
- How deep it goes
- Defines immutable lists, sharing, persistence, and operation costs, but defers broader efficient functional data-structure designs.
- Examples
- Uses Scala singly linked lists with Nil and Cons, including tail, setHead, init, append, map, filter, and flatMap.
- What you can do after
- Build immutable lists and pure recursive operations while reasoning about sharing, persistence, and copying costs.
Read how Functional Programming in Scala, Second Edition explains pure functional data structure →
Elixir in Action, Third Edition
A pure functional data structure is an immutable data structure whose operations produce new values without modifying existing values.
- How it is used
- Separates immutable data modeling from process-based state management in concurrent systems.
- How deep it goes
- Explains benefits and process integration, but defers the underlying TodoList implementation details.
- Examples
- Uses a TodoList with chained additions, date queries, and a TodoServer that delegates requests.
- What you can do after
- Build it from scratch as an immutable data layer behind a stateful process API.
Read how Elixir in Action, Third Edition explains pure functional data structure →
Also covered in
What to know first
- functional programmingFunctional programming is a programming paradigm that expresses computation through the evaluation and composition of functions, typically favoring immutable data and minimizing mutable state and side effects.
- listA list is an ordered collection of elements arranged in a sequence.
Related concepts
- persistent data structurekind of · A persistent data structure preserves access to earlier versions when updates produce new versions rather than modifying existing ones.
- pure functionuses · A pure function is a function whose result depends only on its explicit inputs and whose evaluation has no externally observable side effects.
- data structurekind of · A data structure is an organized representation of data and its relationships that supports defined operations for storing, accessing, or modifying it.
- immutable linked listincludes · An immutable linked list is an ordered sequence of elements linked through nodes that cannot be modified after creation.
- linked listincludes · An ordered sequence of elements stored in separate nodes connected by links or references rather than in one contiguous storage region.
- persistent vectorincludes · A persistent vector is an immutable indexed sequence whose updates preserve earlier versions, typically through structural sharing.
Questions about pure functional data structure
What is pure functional data structure?
A pure functional data structure is immutable: operations produce new versions while preserving existing ones.
Which Manning books explain pure functional data structure?
Functional Programming in Scala, Second Edition and Elixir in Action, Third Edition.
What should I know before learning pure functional data structure?
Manning books that teach pure functional data structure usually introduce functional programming and list first.
What kinds of pure functional data structure are there?
Kinds of pure functional data structure include immutable linked list, linked list and persistent vector.
What is pure functional data structure a kind of?
Pure functional data structure is a kind of persistent data structure. A persistent data structure preserves access to earlier versions when updates produce new versions rather than modifying existing ones.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

