I do not understand last_ ...

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

I do not understand last_ ...

Massimiliano Gubinelli
Hi all,
 I'm a bit puzzled by the following output:

Prelude> import qualified Streaming.Prelude as S
Prelude S> S.last $ S.each [1..100]
Just 100 :> ()
Prelude S> S.last $ (S.slidingWindow 10) $ S.each [1..100]
Nothing :> ()

Why in the second case I obtain a Nothing?
And what is a natural way to output the structure of a Stream  ?

Thanks a lot!