Export of DataStream
map: (T -> T) -> % -> %
Usage
T == Integer;
init(n: MachineInteger, x: DataStream): T == {zero? n => 0; x(n-1) + 1}
s: DataStream T := stream init;
f(t: T): T == 2*t;
t: DataStream T := map(f)(s);
Description
Maps a function on a stream.
Remarks
If the input stream s is eventually constant, the output stream t is eventually constant, too. In other, words, f is supposed to return the same result on the same input.