If random access to elements is not needed then an infinite list would be advantageous.
Usage
T == Integer
s: ListStream T := stream 0;
s := stream(generator [1, 3]);
g: Generator T == generate for i in 2.. repeat yield i;
s := stream g;
Description
Implements an infinite list.
The domain ListStream can be abstractly seen as an infinite list. However, to make this data structure finite, it is more appropriate to view it as a pair (t,g) of an element of T and a Generator(T).