[commit: ghc] master: Revert "Restore invariant in `Data (Ratio a)` instance" (22c4d60)
git at git.haskell.org
git at git.haskell.org
Wed Jan 21 21:13:03 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/22c4d60b0665a15535c0ec9fe0b8e65d2c948e7d/ghc
>---------------------------------------------------------------
commit 22c4d60b0665a15535c0ec9fe0b8e65d2c948e7d
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Wed Jan 21 22:13:07 2015 +0100
Revert "Restore invariant in `Data (Ratio a)` instance"
This reverts commit 79b0d0e633af8302d2dd907663a4a231cd889b67
due to
Compile failed (status 256) errors were:
[1 of 2] Compiling A ( A.hs, A.o )
[2 of 2] Compiling Main ( T4491.hs, T4491.o )
T4491.hs:19:11:
Illegal data constructor name: ‘%’
When splicing a TH expression: (GHC.Real.%) 11 2
In the splice: $(dataToExpQ (const Nothing) (5.5 :: Rational))
*** unexpected failure for T4491(normal)
Therefore re-opening #10011
>---------------------------------------------------------------
22c4d60b0665a15535c0ec9fe0b8e65d2c948e7d
libraries/base/Data/Data.hs | 8 ++++----
libraries/base/changelog.md | 2 --
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/libraries/base/Data/Data.hs b/libraries/base/Data/Data.hs
index 4a6c8be..dce610b 100644
--- a/libraries/base/Data/Data.hs
+++ b/libraries/base/Data/Data.hs
@@ -1059,15 +1059,15 @@ instance Data Word64 where
------------------------------------------------------------------------------
ratioConstr :: Constr
-ratioConstr = mkConstr ratioDataType "%" [] Infix
+ratioConstr = mkConstr ratioDataType ":%" [] Infix
ratioDataType :: DataType
ratioDataType = mkDataType "GHC.Real.Ratio" [ratioConstr]
-instance (Data a, Integral a) => Data (Ratio a) where
- gfoldl k z (a :% b) = z (%) `k` a `k` b
+instance Data a => Data (Ratio a) where
+ gfoldl k z (a :% b) = z (:%) `k` a `k` b
toConstr _ = ratioConstr
- gunfold k z c | constrIndex c == 1 = k (k (z (%)))
+ gunfold k z c | constrIndex c == 1 = k (k (z (:%)))
gunfold _ _ _ = error "Data.Data.gunfold(Ratio)"
dataTypeOf _ = ratioDataType
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 0d7ebcf..83ae5e4 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -140,8 +140,6 @@
* Add `callocArray` and `callocArray0` to `Foreign.Marshal.Array`. (#9859)
- * Restore invariant in `Data (Ratio a)` instance (#10011)
-
## 4.7.0.2 *Dec 2014*
* Bundled with GHC 7.8.4
More information about the ghc-commits
mailing list