Stream (abstract data type)
In type theory and functional programming, a stream is a potentially infinite analog of a list, given by the Algebraic [data type|coinductive definition]:
data Stream α = Nil | Cons α
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 corecursion.
Java provides the interface under the namespace.
JavaScript provides the, and interfaces.
Python have the and classes in the module.
.NET provides the abstract class which is implemented by classes such as and.
In Rust a struct can implement the trait. There is also the struct wraps an in-memory buffer.