From 251845f83ea52965b5205fd231ffa2c87bb34de6 Mon Sep 17 00:00:00 2001 From: Andreas Källberg Date: Wed, 5 Aug 2020 16:20:35 +0200 Subject: First attempt at fixing incompabilities with newer cabal --- src/compiler/GF/Infra/UseIO.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/compiler/GF/Infra') diff --git a/src/compiler/GF/Infra/UseIO.hs b/src/compiler/GF/Infra/UseIO.hs index e27b6e075..4c5a26d32 100644 --- a/src/compiler/GF/Infra/UseIO.hs +++ b/src/compiler/GF/Infra/UseIO.hs @@ -159,6 +159,9 @@ instance ErrorMonad IO where then h (ioeGetErrorString e) else ioError e {- +-- Control.Monad.Fail import will become redundant in GHC 8.8+ +import qualified Control.Monad.Fail as Fail + instance Functor IOE where fmap = liftM instance Applicative IOE where @@ -170,7 +173,15 @@ instance Monad IOE where IOE c >>= f = IOE $ do x <- c -- Err a appIOE $ err raise f x -- f :: a -> IOE a + + #if !(MIN_VERSION_base(4,13,0)) + fail = raise + #endif + +instance Fail.MonadFail IOE where fail = raise + + -} -- | Print the error message and return a default value if the IO operation 'fail's -- cgit v1.2.3