commit b9e6c5cba6366dafd8b05be722a4df814bd80f5f
Author: Daniel Fischer <daniel.is.fischer@googlemail.com>
Date: Tue May 17 23:04:35 2011 +0200
Add old behaviour of gcd
The behaviour of gcd was changed to "gcd 0 0 = 0", here we must keep
the haskell2010 behaviour and raise an error.
diff git a/Prelude.hs b/Prelude.hs
index 38cb3b4..9be6ccf 100644
a

b

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