[commit: ghc] ghc-7.2: fix Binary instance for TyCon following Typeable implementation (69d8e7f)
Ian Lynagh
igloo at earth.li
Tue Jul 12 21:56:37 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-7.2
http://hackage.haskell.org/trac/ghc/changeset/69d8e7f4b36b4f834b4458eecc8704ec9deb2784
>---------------------------------------------------------------
commit 69d8e7f4b36b4f834b4458eecc8704ec9deb2784
Author: Simon Marlow <marlowsd at gmail.com>
Date: Mon Jul 11 14:06:01 2011 +0100
fix Binary instance for TyCon following Typeable implementation
changes
>---------------------------------------------------------------
compiler/utils/Binary.hs | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index d9646f6..b61b283 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -76,6 +76,9 @@ import Data.Array
import Data.IORef
import Data.Char ( ord, chr )
import Data.Typeable
+#if __GLASGOW_HASKELL__ >= 701
+import Data.Typeable.Internal
+#endif
import Control.Monad ( when )
import System.IO as IO
import System.IO.Unsafe ( unsafeInterleaveIO )
@@ -576,6 +579,14 @@ instance Binary (Bin a) where
-- -----------------------------------------------------------------------------
-- Instances for Data.Typeable stuff
+#if __GLASGOW_HASKELL__ >= 701
+instance Binary TyCon where
+ put_ bh (TyCon _ p m n) = do
+ put_ bh (p,m,n)
+ get bh = do
+ (p,m,n) <- get bh
+ return (mkTyCon3 p m n)
+#else
instance Binary TyCon where
put_ bh ty_con = do
let s = tyConString ty_con
@@ -583,6 +594,7 @@ instance Binary TyCon where
get bh = do
s <- get bh
return (mkTyCon s)
+#endif
instance Binary TypeRep where
put_ bh type_rep = do
More information about the Cvs-ghc
mailing list