Fri Nov 20 08:57:20 CET 2009 Lennart Kolmodin * Data.Binary.Strict.Class: compiles with ghc-6.12rc1 diff -rN -u old-binary-low-level/src/Data/Binary/Strict/Class.hs new-binary-low-level/src/Data/Binary/Strict/Class.hs --- old-binary-low-level/src/Data/Binary/Strict/Class.hs 2009-11-20 10:17:51.831730903 +0200 +++ new-binary-low-level/src/Data/Binary/Strict/Class.hs 2009-11-20 10:17:51.840983949 +0200 @@ -4,7 +4,7 @@ -- -fno-monomorphism-restriction is very useful. module Data.Binary.Strict.Class where -import Control.Applicative(Alternative(..)) +import qualified Control.Applicative as A (Alternative(..)) import qualified Data.ByteString as B import Data.Word @@ -12,7 +12,7 @@ -- | This is the generic class for the set of binary parsers. This lets you -- write parser functions which are agnostic about the pattern of parsing -- in which they get used (incremental, strict, bitwise etc) -class (Monad m, Alternative m) => BinaryParser m where +class (Monad m, A.Alternative m) => BinaryParser m where skip :: Int -> m () bytesRead :: m Int remaining :: m Int @@ -48,7 +48,7 @@ many :: m a -> m [a] many p = do - v <- (p >>= return . Just) <|> (return Nothing) + v <- (A.<|>) (p >>= return . Just) (return Nothing) case v of Just x -> do rest <- many p @@ -63,7 +63,7 @@ x -> return x optional :: m a -> m (Maybe a) - optional p = (p >>= return . Just) <|> return Nothing + optional p = (A.<|>) (p >>= return . Just) (return Nothing) getWord8 :: m Word8 getByteString :: Int -> m B.ByteString