[commit: ghc] wip/ttypeable: Binary: Compatibility with base<4.10 (80800f0)
git at git.haskell.org
git at git.haskell.org
Sun Jan 29 20:21:47 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/ttypeable
Link : http://ghc.haskell.org/trac/ghc/changeset/80800f05451e41120f7f7e2b9516c54f177ef6d0/ghc
>---------------------------------------------------------------
commit 80800f05451e41120f7f7e2b9516c54f177ef6d0
Author: Ben Gamari <ben at smart-cactus.org>
Date: Sat Jan 28 02:23:59 2017 -0500
Binary: Compatibility with base<4.10
>---------------------------------------------------------------
80800f05451e41120f7f7e2b9516c54f177ef6d0
compiler/utils/Binary.hs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index 56bf1e2..5e894fd 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -566,6 +566,7 @@ instance Binary (Bin a) where
-- -----------------------------------------------------------------------------
-- Instances for Data.Typeable stuff
+#if MIN_VERSION_base(4,10,0)
instance Binary TyCon where
put_ bh tc = do
put_ bh (tyConPackage tc)
@@ -574,9 +575,14 @@ instance Binary TyCon where
put_ bh (tyConKindVars tc)
put_ bh (tyConKindRep tc)
get bh =
-#if MIN_VERSION_base(4,10,0)
mkTyCon <$> get bh <*> get bh <*> get bh <*> get bh <*> get bh
#else
+instance Binary TyCon where
+ put_ bh tc = do
+ put_ bh (tyConPackage tc)
+ put_ bh (tyConModule tc)
+ put_ bh (tyConName tc)
+ get bh =
mkTyCon3 <$> get bh <*> get bh <*> get bh
#endif
More information about the ghc-commits
mailing list