-
Notifications
You must be signed in to change notification settings - Fork 13
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
Should queues track size? #25
Comments
Imo |
Superseded by #33. |
I think we should open this idea back up. I disagree that people generally expect size to be |
Well, I do generally expect For A few examples where you want fast
|
FWIW, I've dug into all the packages on Hackage that show a dependency on Real dependencies
False dependencies
If, as this limited survey suggests, using |
TBH, I think this primarily shows that not many packages depend on |
It's possible to calculate the size in amortized
O(log n)
time. Once #24 is finished, that will improve to worst-caseO(log n)
time (except in the presence of pathological nesting ofmapMonotonic
calls). Is it really worth tracking the size to get that toO(1)
? It's not terribly expensive, but it's one more word of allocation oninsert
.The text was updated successfully, but these errors were encountered: