-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy zip
is stricter than expected
#667
Comments
As a bonus, the new code is easier to read and doesn't trigger a spurious incomplete-pattern-match warning. (Or finding the bug can be seen as a bonus for cleaning up that messy code.) Fixes haskell#667.
* Make D.B.Lazy.zipWith properly lazy As a bonus, the new code is easier to read and doesn't trigger a spurious incomplete-pattern-match warning. (Or finding the bug can be seen as a bonus for cleaning up that messy code.) Fixes #667. * Lazy.zipWith: evaluate the 'unsafeHead' calls eagerly
I'm not sure if this is fine to go into |
I think it's fine to backport. We have included similar laziness-increasing changes in other recent minor releases:
The old strictness behavior for
And that behavior...
And of course internal-chunk-boundary-dependent strictness means that the old behavior can distinguish between "equal"
|
* Make D.B.Lazy.zipWith properly lazy As a bonus, the new code is easier to read and doesn't trigger a spurious incomplete-pattern-match warning. (Or finding the bug can be seen as a bonus for cleaning up that messy code.) Fixes #667. * Lazy.zipWith: evaluate the 'unsafeHead' calls eagerly
Fair enough, backported. |
I expect
BL.zip x y
to be equivalent toList.zip (BL.unpack x) (BL.unpack y)
. And yet ifx = BL.replicate 2 0 <> error "lazy tail"
andy = BL.singleton 0
we observe the former to be(0, 0) : error "lazy tail"
and the latter to be(0, 0) : []
.The text was updated successfully, but these errors were encountered: