Open treeowl opened 8 years ago
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.
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
.
If
fromEnum
can produce negative numbers (e.g., if you try to make aBitSet Int
), then everything breaks badly (GMP exceptions). As far as I can tell, this is not documented.