liveBook · Manning

Infinite data structure

An infinite data structure is a structure representing an unbounded number of elements, whether stored or generated on demand.

How 2 Manning books explain it

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 →

Also covered in

What to know first

Related concepts

Questions about infinite data structure

What is infinite data structure?

An infinite data structure is a structure representing an unbounded number of elements, whether stored or generated on demand.

Which Manning books explain infinite data structure?

Clojure: The Essential Reference and Learn Haskell by Example.

What should I know before learning infinite data structure?

Manning books that teach infinite data structure usually introduce function first.

What is infinite data structure a kind of?

Infinite data structure is a kind of data source. A data source is an origin, system, repository, or process from which data is obtained or made available for use or processing.

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.