Add instance Bounded (Ratio a)

Eric Mertens emertens at gmail.com
Sun Jun 16 18:29:54 UTC 2019


Ratio only only generally be used with Integer, which isn’t itself an instance of Bounded. This probably wouldn’t be a very useful instance. It has overflow issues with Bounded types like Int for various operations including comparisons.

> On Jun 16, 2019, at 10:14 AM, Vanessa McHale <vanessa.mchale at iohk.io> wrote:
> 
> Signed PGP part
> Seems sensible. Out of curiosity, what would this help with?
> 
> On 6/14/19 6:44 PM, Dannyu NDos wrote:
>> instance (Integral a, Bounded a) => Bounded (Ratio a) where
>>     minBound = minBound % 1
>>     maxBound = maxBound % 1
>> 
>> 
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org <mailto:Libraries at haskell.org>
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries <http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190616/84274cd9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190616/84274cd9/attachment.sig>


More information about the Libraries mailing list