Skip to content
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

Use Int for capacity in TBQueue interface again? #74

Open
konsumlamm opened this issue Oct 5, 2023 · 0 comments
Open

Use Int for capacity in TBQueue interface again? #74

konsumlamm opened this issue Oct 5, 2023 · 0 comments

Comments

@konsumlamm
Copy link
Contributor

In #17 / 2221948, the type for the capacity of TBQueues was changed from Int to Natural, to avoid negative capacities. With #70, the capacity is now internally stored as an Int (since array lengths are Ints), so IMO it would make sense to change the public API back to Ints. Moreover, we need to check that the capacity is greater than 0 anyway and currently we additionally have to check that the capacity is not greater than maxBound :: Word. This would also avoid potentially having to unbox/box Naturals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant