Re: Re: Shouldn't collection zip functions return streams?

Rex Kerr <[email protected]> Sat, 28 Nov 2015 14:54:25 -0800
Newsgroups gmane.comp.lang.scala
Message-ID <CAP_xLa2GeqGtk35d3iWgieCinZn8y7e0XrQELa7gb6Ju4THS0g@mail.gmail.com>
This isn't entirely true.  Laziness brings its own sets of issues, in that
you either have a very limited set of operations, or you can be hit by
massive performance bugs caused by innocently reusing an intermediate
operation that is expensive to materialize.  Also, many things involving
mutation are easier to reason about in eagerly evaluated code.  So there
can be big pitfalls in correctness, performance, and reusability with
lazily evaluated code.

So merely being lazy isn't enough.  You need really clearly defined
boundaries between lazy and eager evaluation with an easy way to jump
between the two, to really enable correctness, performance, and
reusability.  And, yes, that's beyond the scope of the current collections
design.

  --Rex


On Thu, Nov 26, 2015 at 7:45 PM, Simon Ochsenreither <
[email protected]> wrote:

>
> AFAIK, (c1, c2).zipped performs a lazy zip of c1, c2.
>>
>
> Absolutely correct. The largest issue with the rest of collections is that
> they evaluate things eagerly. Every other problem follows from that. We are
> paying an extremely high price in terms of correctness, performance and
> reusability for a slight increase in convenience.
> Within the current design none of them can be addressed.
>
> --
> You received this message because you are subscribed to the Google Groups
> "scala-language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.