liveBook · Manning

Recursive data structure

A recursive data structure is a structure whose definition directly or indirectly refers to another instance of the same structure.

How 2 Manning books explain it

Functional Design and Architecture: Examples in Haskell

A recursive data type is a type whose definition refers to itself, allowing it to represent recursively structured values.

How it is used
Models domain values and computation chains whose depth is not fixed in advance.
How deep it goes
Explains recursive constructors through lists and Free, including recursive mapping and the type-growth problem.
Examples
Uses person lists, recursive `fmap`, and sandwich-action scripts with the `Free` type.
What you can do after
Evaluate/understand how self-referential constructors represent variable-depth values and keep chained scripts uniformly typed.

Read how Functional Design and Architecture: Examples in Haskell explains recursive data structure →

Elixir in Action, Third Edition

A recursive data structure is a structure whose elements or parts can contain structures of the same form.

How it is used
Explains list representation and performance trade-offs before applying head-tail pattern matching.
How deep it goes
Explains internal head-tail construction, constant-time access, linear updates, and improper-list boundaries.
Examples
Uses nested cons-style expressions, head-tail matches, list updates, concatenation, and a recursive list diagram.
What you can do after
Apply Elixir head-tail syntax to construct, decompose, and reason about list access and update costs.

Read how Elixir in Action, Third Edition explains recursive data structure →

Related concepts

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.