3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-0.5.1.0.patch
Mike Sperber 53cfd1d132 haskell-tensorflow: unbreak
- get the current Git head of haskell-tensorflow
- adjust dependencies
2020-04-17 20:50:48 +02:00

24 lines
905 B
Diff

diff --git a/src/Data/ProtoLens/Encoding/Parser/Internal.hs b/src/Data/ProtoLens/Encoding/Parser/Internal.hs
index 30eeaad..f2703e7 100644
--- a/src/Data/ProtoLens/Encoding/Parser/Internal.hs
+++ b/src/Data/ProtoLens/Encoding/Parser/Internal.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE CPP #-}
-- | Definition of the parsing monad, plus internal
-- unsafe functions.
module Data.ProtoLens.Encoding.Parser.Internal
@@ -36,8 +37,11 @@ instance Applicative Parser where
(<*>) = ap
instance Monad Parser where
- fail s = Parser $ \_ _ -> return $ ParseFailure s
return = pure
Parser f >>= g = Parser $ \end pos -> f end pos >>= \case
ParseSuccess pos' x -> unParser (g x) end pos'
ParseFailure s -> return $ ParseFailure s
+#if MIN_VERSION_base(4,13,0)
+instance MonadFail Parser where
+#endif
+ fail s = Parser $ \_ _ -> return $ ParseFailure s