-
Notifications
You must be signed in to change notification settings - Fork 72
Implement withFilter #145
Comments
|
@pnf - |
I agree it's a hint that traversal will occur at most once, though I don't see how the probability of complete consumption figures. If anything, it's more valuable to avoid the intermediate when it won't be consumed.
I understand that we can't actually get rid of withFilter especially after the recent celebration over requiring it, but the for desugaring could be enhanced to make it easier to be fully lazy. Admittedly it requires type awareness, but @adriaanm's comment in scala/scala#5725 seems to imply there's some openness to extending for-desugaring past the parser stage. We could even do applicatives...
… On Jul 4, 2017, at 7:22 PM, Ichoran ***@***.***> wrote:
@pnf - withFilter is a special hint that the contents are ultimately likely to be consumed in full and traversed exactly once. There are cases where this is very valuable information regarding performance. Because for desugaring is not specific to collections, it makes sense to retain this distinction (inasmuch as it ever did). We can implement withFilter as .view.filter, but we shouldn't use the collections rewrite as justification for removing withFilter.
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
BTW, do we need |
@julienrf Out of hand, I don't see a need of Regarding If we follow the recommendations there, it would be good to have an |
No description provided.
The text was updated successfully, but these errors were encountered: