Stream (abstract data type)

From HandWiki

In type theory and functional programming, a stream is a potentially infinite analog of a list, given by the coinductive definition:[1][2]

data Stream α = Nil | Cons α (Stream α)

Generating and computing with streams requires lazy evaluation, either implicitly in a lazily evaluated language or by creating and forcing thunks in an eager language. In total languages they must be defined as codata and can be iterated over using (guarded) corecursion.

UML package diagram of the stream hierarchy in .NET

See also

References

  1. Yamagiwa, Shinichi (2022), Katoh, Naoki; Higashikawa, Yuya; Ito, Hiro et al., eds., "Stream-Based Lossless Data Compression" (in en), Sublinear Computation Paradigm: Algorithmic Revolution in the Big Data Era (Singapore: Springer): pp. 391–410, doi:10.1007/978-981-16-4095-7_16, ISBN 978-981-16-4095-7 
  2. Sangma, Jerry W.; Sarkar, Mekhla; Pal, Vipin; Agrawal, Amit; Yogita (2022-04-01). "Hierarchical clustering for multiple nominal data streams with evolving behaviour" (in en). Complex & Intelligent Systems 8 (2): 1737–1761. doi:10.1007/s40747-021-00634-0. ISSN 2198-6053.