Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b68714c2a66edd0bbc551c3d2ebdcd4892bf1ea1

>---------------------------------------------------------------

commit b68714c2a66edd0bbc551c3d2ebdcd4892bf1ea1
Author: Daniel Fischer <[email protected]>
Date:   Mon Sep 19 12:36:22 2011 +0200

    Use the Ratio constructor for toRational from Int/Integer
    
    The denominator is always 1, so there's no need for gcd.

>---------------------------------------------------------------

 GHC/Real.lhs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/GHC/Real.lhs b/GHC/Real.lhs
index 2aa54c6..8597c45 100644
--- a/GHC/Real.lhs
+++ b/GHC/Real.lhs
@@ -243,7 +243,7 @@ numericEnumFromThenTo e1 e2 e3
 
 \begin{code}
 instance  Real Int  where
-    toRational x        =  toInteger x % 1
+    toRational x        =  toInteger x :% 1
 
 instance  Integral Int  where
     toInteger (I# i) = smallInteger i
@@ -298,7 +298,7 @@ instance  Integral Int  where
 
 \begin{code}
 instance  Real Integer  where
-    toRational x        =  x % 1
+    toRational x        =  x :% 1
 
 instance  Integral Integer where
     toInteger n      = n



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to