You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
— Since it is written in terms of foldl, it cannot be any less strict, and foldl forces all the spine. There is a way to write scanl in terms of foldr though! See here for example.
I checked the strictness property and I found that the current definition forces all the spine and that an alternative definition may be given in terms of foldr that is strictly lazier.
Am I missing something or should this be fixed? If it should be fixed, I can do it on the cheap as part of #364 since I am already writing a bunch of strictness checks for all other lazy scans there.
The text was updated successfully, but these errors were encountered:
See the source code:
bytestring/Data/ByteString/Lazy.hs
Line 611 in 416b719
— Since it is written in terms of
foldl
, it cannot be any less strict, andfoldl
forces all the spine. There is a way to writescanl
in terms offoldr
though! See here for example.I checked the strictness property and I found that the current definition forces all the spine and that an alternative definition may be given in terms of
foldr
that is strictly lazier.This is the code I am using to check strictness:
Am I missing something or should this be fixed? If it should be fixed, I can do it on the cheap as part of #364 since I am already writing a bunch of strictness checks for all other lazy scans there.
The text was updated successfully, but these errors were encountered: