Stream (computer science)
For the more applied concept in computing, see Stream (computing).
In type theory and functional programming, a stream is a potentially infinite analog of a list, given by the coinductive definition:
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.
See also
This article is issued from Wikipedia - version of the 9/11/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.