[commit: base] master: Use the Ratio constructor for toRational from Int/Integer (b68714c)
Daniel Fischer
dafis at galois.com
Mon Sep 19 16:16:49 CEST 2011
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 <daniel.is.fischer at googlemail.com>
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
More information about the Cvs-libraries
mailing list