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
importqualifiedData.Vector.UnboxedasUmain::IO()
main =doprint$U.take4$U.generate (maxBound-4) idU.++U.generate (maxBound-4) id
One could think that it will print [0,1,2,3] provided it will fuse. It however fails with.
overflow: Data.Vector.Fusion.Bundle.Size.checkedAdd: overflow: -10
CallStack (from HasCallStack):
error, called at src/Data/Vector/Fusion/Bundle/Size.hs:56:7 in vector-0.13.0.1-KtkGVThkqZeLj5OVQdyUBP:Data.Vector.Fusion.Bundle.Size
This happens because computation of both exact vector length and upper bound on vector size throws error if it overflows Int. I wasn't able to craft example which overflows maximum bound on length which is much more realistic.
This issue is mostly to record that error on error on overflow could cause problems. I'd propose following semantics change: overflow for upper bound on vector size reverts to unbounded. Overflow for lower bound does cause error. (Note not expressible with current implementation of size)
Activity
Add simple test of equivalence of unstream variants
Add simple test of equivalence of unstream variants