Hello,
I am trying to use streams to delay memory and CPU usage. Initially I tried to use Stream.foldLeft
to perform the transformation indicated in the header. I realized that the fold consumes all elements in the stream. After posting
and deleting a question regarding this I now and realizing that in fact it does make sense that fold traverse the
whole stream.
My question is basically this: is it possible to perform the transformation so the the resulting type contains
a lazy stream (without traversing the all elements)?
TIA