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

Document Enum choice restriction #20

Open
treeowl opened this issue Jun 8, 2016 · 2 comments
Open

Document Enum choice restriction #20

treeowl opened this issue Jun 8, 2016 · 2 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Jun 8, 2016

If fromEnum can produce negative numbers (e.g., if you try to make a BitSet Int), then everything breaks badly (GMP exceptions). As far as I can tell, this is not documented.

@superbobry
Copy link
Member

Good catch, this is indeed undocumented.

I wonder if we can use another Enum-like class with non-negative fromEnum function? If not, I guess all we can do is document it and add a check to relevant functions.

@treeowl
Copy link
Contributor Author

treeowl commented Jun 8, 2016

I discovered it by mistake when I tried to make a Data.BitSet.Generic.BitSet Int Word16 and accidentally made a Data.BitSet.Dynamic.BitSet Int.

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

2 participants