summaryrefslogtreecommitdiff
path: root/compiler/utils/Binary.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-03-23 18:25:57 +0000
committerIan Lynagh <igloo@earth.li>2008-03-23 18:25:57 +0000
commitfcf6b22d0478be20e27c2245f3e34dd272e12522 (patch)
tree7b33e0ecfddef9bd27f963b13e332baca0ae4db4 /compiler/utils/Binary.hs
parent7f0471be1cfe0ef6110ef7fdd8132d85387d0b21 (diff)
downloadhaskell-fcf6b22d0478be20e27c2245f3e34dd272e12522.tar.gz
Follow library changes
Integer, Bool and Unit/Inl/Inr are now in new packages integer and ghc-prim.
Diffstat (limited to 'compiler/utils/Binary.hs')
-rw-r--r--compiler/utils/Binary.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index ad048b6674..466a515dfc 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -467,6 +467,14 @@ instance (Binary a, Binary b) => Binary (Either a b) where
-- yes, we need Binary Integer and Binary Rational in basicTypes/Literal.lhs
instance Binary Integer where
+ -- XXX This is hideous
+ put_ bh i = put_ bh (show i)
+ get bh = do str <- get bh
+ case reads str of
+ [(i, "")] -> return i
+ _ -> fail ("Binary Integer: got " ++ show str)
+
+ {-
put_ bh (S# i#) = do putByte bh 0; put_ bh (I# i#)
put_ bh (J# s# a#) = do
putByte bh 1
@@ -484,6 +492,7 @@ instance Binary Integer where
sz <- get bh
(BA a#) <- getByteArray bh sz
return (J# s# a#)
+-}
-- As for the rest of this code, even though this module
-- exports it, it doesn't seem to be used anywhere else