PROPOSAL: toBoundedIntegral: an adaptation of fromIntegral that respects bounds

Sean Leather sean.leather at gmail.com
Fri Nov 21 04:42:57 UTC 2014


On Fri, Nov 21, 2014 at 1:08 AM, David Feuer wrote:

> That bitSizeMaybe makes me a bit nervous.


Can you clarify what makes you nervous about it? Is it the assumption that
when bitSizeMaybe == Nothing, the size is infinite?

Would it actually hurt anyone to make this thing a subclass of FiniteBits?

Er... Obviously, I mean give this a FiniteBits *context*.
>

Yes, it would reduce the usefulness of the function to finite types in the
result, whereas now it can be used, for example, to convert Integer to
Natural.

Regards,
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141121/bc612d9c/attachment.html>


More information about the Libraries mailing list