From 8c86567be6c348693444aa038f7c7aac1ed4fd11 Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Wed, 3 Aug 2005 02:52:34 +0000 Subject: [PATCH] Adjust hi-parsing to new interface format. NB: This will break hs-plugins for all versions of ghc-6.5 before 2005/07/28 05:57:14 PDT --- src/hi/Language/Hi/Binary.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hi/Language/Hi/Binary.hs b/src/hi/Language/Hi/Binary.hs index 6b1edbf..8b43ac9 100644 --- a/src/hi/Language/Hi/Binary.hs +++ b/src/hi/Language/Hi/Binary.hs @@ -343,12 +343,23 @@ instance Binary Int where #endif instance Binary a => Binary [a] where +#if __GLASGOW_HASKELL__ < 605 get bh = do h <- getWord8 bh case h of 0 -> return [] _ -> do x <- get bh xs <- get bh return (x:xs) +#else + get bh = do + b <- getByte bh + len <- if b == 0xff + then get bh + else return (fromIntegral b :: Word32) + let loop 0 = return [] + loop n = do a <- get bh; as <- loop (n-1); return (a:as) + loop len +#endif instance (Binary a, Binary b) => Binary (a,b) where get bh = do a <- get bh