Is there any way or way to get each next element from the stream?
For example, if there is a stream similar to
def natural: Stream[Long] = { def naturalHelper: Long => Stream[Long] = { n => n
I am looking for something like s.next() , returning 2 on the first call, s.next () = 3 on the next call, etc .... without using var .
source share