summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Data
diff options
context:
space:
mode:
authorAndreas Källberg <anka.213@gmail.com>2020-08-05 16:51:24 +0200
committerAndreas Källberg <anka.213@gmail.com>2020-08-05 18:48:24 +0200
commitb8812b54b2dd70df1038a5cd953b4bbb8ac1e9b4 (patch)
tree1e61a2cd878ddf124d83903cdb63f9f5e9f48725 /src/compiler/GF/Data
parent251845f83ea52965b5205fd231ffa2c87bb34de6 (diff)
fix newer ghc: Don't try to be backwards compatible
Diffstat (limited to 'src/compiler/GF/Data')
-rw-r--r--src/compiler/GF/Data/BacktrackM.hs2
-rw-r--r--src/compiler/GF/Data/ErrM.hs15
2 files changed, 3 insertions, 14 deletions
diff --git a/src/compiler/GF/Data/BacktrackM.hs b/src/compiler/GF/Data/BacktrackM.hs
index f5ae63997..87ea4dc5a 100644
--- a/src/compiler/GF/Data/BacktrackM.hs
+++ b/src/compiler/GF/Data/BacktrackM.hs
@@ -69,6 +69,8 @@ instance Monad (BacktrackM s) where
return a = BM (\c s b -> c a s b)
BM m >>= k = BM (\c s b -> m (\a s b -> unBM (k a) c s b) s b)
where unBM (BM m) = m
+
+instance MonadFail (BacktrackM s) where
fail _ = mzero
instance Functor (BacktrackM s) where
diff --git a/src/compiler/GF/Data/ErrM.hs b/src/compiler/GF/Data/ErrM.hs
index 0cef54816..5ea7f0734 100644
--- a/src/compiler/GF/Data/ErrM.hs
+++ b/src/compiler/GF/Data/ErrM.hs
@@ -16,10 +16,6 @@ module GF.Data.ErrM where
import Control.Monad (MonadPlus(..),ap)
import Control.Applicative
-#if !MIN_VERSION_base(4,11,0)
--- Control.Monad.Fail import is redundant since GHC 8.8.1
-import qualified Control.Monad.Fail as Fail
-#endif
-- | Like 'Maybe' type with error msgs
data Err a = Ok a | Bad String
@@ -40,17 +36,8 @@ instance Monad Err where
Ok a >>= f = f a
Bad s >>= f = Bad s
-#if !(MIN_VERSION_base(4,11,0))
+instance MonadFail Err where
fail = Bad
-#endif
-
-instance Fail.MonadFail Err where
- fail = Bad
-
--- Control.Monad.Fail import will become redundant in GHC 8.8+
-import qualified Control.Monad.Fail as Fail
-
-