commit 7a4246791fb14ca63bb23fd7f7b2d8cf6a9a4b2f
Author: Daniel Fischer <daniel.is.fischer@googlemail.com>
Date: Tue May 17 23:01:47 2011 +0200
Add old behaviour of gcd
The behaviour of gcd was changed to "gcd 0 0 = 0", here we must keep
the haskell98 behaviour and raise an error.
diff git a/Prelude.hs b/Prelude.hs
index a09a300..44342a0 100644
a

b

import GHC.Base 
151  151  import Text.Read 
152  152  import GHC.Enum 
153  153  import GHC.Num 
154   import GHC.Real 
 154  import GHC.Real hiding ( gcd ) 
 155  import qualified GHC.Real ( gcd ) 
155  156  import GHC.Float 
156  157  import GHC.Show 
157  158  import GHC.Err ( undefined ) 
… 
… 
seq _ y = y 
207  208  catch :: IO a > (IOError > IO a) > IO a 
208  209  catch = New.catch 
209  210  
 211  #ifdef __GLASGOW_HASKELL__ 
 212    @'gcd' x y@ is the greatest (positive) integer that divides both @x@ 
 213   and @y@; for example @'gcd' (3) 6@ = @3@, @'gcd' (3) (6)@ = @3@, 
 214   @'gcd' 0 4@ = @4@. @'gcd' 0 0@ raises a runtime error. 
 215  gcd :: (Integral a) => a > a > a 
 216  gcd 0 0 = error "Prelude.gcd: gcd 0 0 is undefined" 
 217  gcd x y = GHC.Real.gcd x y 
 218  #endif 