[commit: packages/binary] master: Fix to compile with GHC 6.10.4 (d4568ca)

git at git.haskell.org git at git.haskell.org
Sun Dec 14 17:55:13 UTC 2014


Repository : ssh://git@git.haskell.org/binary

On branch  : master
Link       : http://git.haskell.org/packages/binary.git/commitdiff/d4568cae23e31e8d222de843f5f6f269983b92ba

>---------------------------------------------------------------

commit d4568cae23e31e8d222de843f5f6f269983b92ba
Author: Lennart Kolmodin <kolmodin at gmail.com>
Date:   Sun May 18 12:58:33 2014 +0400

    Fix to compile with GHC 6.10.4
    
    Before base-4.2.0.0 Alternative didn't define 'many' and 'some'.
    Use conditional to exclude those definitions on GHC < 6.12.1.
    
    This issue was reported in issue #55.


>---------------------------------------------------------------

d4568cae23e31e8d222de843f5f6f269983b92ba
 src/Data/Binary/Get/Internal.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/Data/Binary/Get/Internal.hs b/src/Data/Binary/Get/Internal.hs
index 03305ea..9b53831 100644
--- a/src/Data/Binary/Get/Internal.hs
+++ b/src/Data/Binary/Get/Internal.hs
@@ -248,12 +248,14 @@ instance Alternative Get where
       Done inp x -> C $ \_ ks -> ks inp x
       Fail _ _ -> pushBack bs >> g
       _ -> error "Binary: impossible"
+#if MIN_VERSION_base(4,2,0)
   some p = (:) <$> p <*> many p
   many p = do
     v <- (Just <$> p) <|> pure Nothing
     case v of
       Nothing -> pure []
       Just x -> (:) x <$> many p
+#endif
 
 -- | Run a decoder and keep track of all the input it consumes.
 -- Once it's finished, return the final decoder (always 'Done' or 'Fail'), 



More information about the ghc-commits mailing list