Infinite data structure
An infinite data structure represents or generates an unbounded number of elements, commonly by producing them lazily rather than storing them all.
Clojure: The Essential Reference
An infinite sequence is a sequence with unboundedly many elements, typically generated on demand.
- How it is used
- Supplies unbounded inputs for sequential processing, evolving states, and on-demand work generation.
- How deep it goes
- Defines generator contracts and exceptions, works through stateful examples, and demonstrates memory and performance consequences of laziness.
- Examples
- Demonstrates Fibonacci pairs, a pi approximation, Game of Life states, random values, and lazy worker batches.
- What you can do after
- Build it from scratch with lazy-seq and cons, or apply it via iterate to generate and consume successive states.
Read how Clojure: The Essential Reference explains infinite data structure →
Learn Haskell by Example
An infinite list is a lazily generated list with no finite endpoint whose finite prefixes can be evaluated on demand.
- How it is used
- Builds reusable signal-processing curves without calculating their lengths in advance.
- How deep it goes
- Explains lazy generation, safe finite-demand operations, recursive definitions, range syntax, and the failure of full evaluation.
- Examples
- Demonstrates recursive ones, natural and odd-number ranges, repeat, finite zipping, and an ADSR audio envelope.
- What you can do after
- Apply it via take, repeat, range syntax, zipWith, and zipWith3 while avoiding operations that demand complete evaluation.
Read how Learn Haskell by Example explains infinite data structure →
Related concepts
- iterateproduced by · Iterate is an operation that advances through successive values or states according to specified functions or iteration rules.
- cycleproduced by · cycle is an iterator operation that repeatedly traverses a source sequence, indefinitely or for a specified number of repetitions.
- repeatproduced by · repeat is a function that produces a sequence containing repeated copies of a value, either finitely or indefinitely.
- lazy evaluationused by · Lazy evaluation is an evaluation strategy that defers computing an expression or value until its result is needed, potentially avoiding the computation entirely.
- taggingcontrasts with · Tagging is the assignment of descriptive labels or metadata to information or resources to support their identification, classification, organization, filtering, or retrieval.
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.

