Default definition for fromRational

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Default definition for fromRational

Joe Hermaszewski
A suitable default definition for fromRational could be the following:

fromRational n = fromInteger (numerator n) / fromInteger (denominator n)

Changing the MINIMUM pragma to just {-# MINIMAL recip | (/) #-}

- Joe
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Default definition for fromRational

Edward Kmett-2
True. I can't think of any issues off hand.

-Edward



On Thu, Oct 15, 2015 at 6:51 PM, Joe Hermaszewski <[hidden email]> wrote:
A suitable default definition for fromRational could be the following:

fromRational n = fromInteger (numerator n) / fromInteger (denominator n)

Changing the MINIMUM pragma to just {-# MINIMAL recip | (/) #-}

- Joe
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries