There is a special stream called `End` that represents a stream that
contains no (more) elements, analogous to the empty list `[]`.
There is a special stream called `End` that represents a stream that
contains no (more) elements, analogous to the empty list `[]`.
applying it to the unit. Watch the behavior of this stream in detail.
This stream delivers the natural numbers, in order: 1, 2, 3, ...
applying it to the unit. Watch the behavior of this stream in detail.
This stream delivers the natural numbers, in order: 1, 2, 3, ...
val int_stream : int stream = Next (1, [fun]) (* First element: 1 *)
# let tail = match int_stream with Next (i, rest) -> rest;;
val int_stream : int stream = Next (1, [fun]) (* First element: 1 *)
# let tail = match int_stream with Next (i, rest) -> rest;;