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
The size of the set must not exceed maxBound::Int. Violation of this condition is not detected and if the size limit is exceeded, its behaviour is undefined.
However, we multiple sizes by delta = 3 without caring about overflow when balancing, which means we get violated invariants earlier than that.
I doubt anyone will be running into this in practice, but the limit should be document as maxBound `div` 3 perhaps. Or less, in case there are other potentially troublesome operations I missed.
The text was updated successfully, but these errors were encountered:
Good point. Is it possible to avoid the problem by being careful about how we do the comparisons? It's not an issue for 64 bit, but we still (nominally) support 32 bit, and (theoretically) 29 bit.
Hmph. That does sound like a slowdown. Checking for overflow would probably be a slowdown too (more work for branch prediction), but what do I know? Changing the documentation is at least easy.
Set
andMap
documentation carry warnings that sayHowever, we multiple sizes by
delta = 3
without caring about overflow when balancing, which means we get violated invariants earlier than that.I doubt anyone will be running into this in practice, but the limit should be document as
maxBound `div` 3
perhaps. Or less, in case there are other potentially troublesome operations I missed.The text was updated successfully, but these errors were encountered: