diff options
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/IOEnv.hs | 2 | ||||
-rw-r--r-- | compiler/utils/ListT.hs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index 5a7ccd9972..6fc5f9dc67 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -56,7 +56,7 @@ unIOEnv (IOEnv m) = m instance Monad (IOEnv m) where (>>=) = thenM (>>) = (*>) - fail _ = failM -- Ignore the string + fail = MonadFail.fail instance MonadFail.MonadFail (IOEnv m) where fail _ = failM -- Ignore the string diff --git a/compiler/utils/ListT.hs b/compiler/utils/ListT.hs index 2b81db1ed4..7dc1aa3eaf 100644 --- a/compiler/utils/ListT.hs +++ b/compiler/utils/ListT.hs @@ -32,6 +32,7 @@ module ListT ( import Control.Applicative import Control.Monad +import Control.Monad.Fail as MonadFail ------------------------------------------------------------------------- -- | A monad transformer for performing backtracking computations @@ -64,6 +65,9 @@ instance Alternative (ListT f) where instance Monad (ListT m) where m >>= f = ListT $ \sk fk -> unListT m (\a fk' -> unListT (f a) sk fk') fk + fail = MonadFail.fail + +instance MonadFail (ListT m) where fail _ = ListT $ \_ fk -> fk instance MonadPlus (ListT m) where |