summaryrefslogtreecommitdiff
path: root/compiler/utils/ListT.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/ListT.hs')
-rw-r--r--compiler/utils/ListT.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/utils/ListT.hs b/compiler/utils/ListT.hs
index 2b81db1ed4..c16701419d 100644
--- a/compiler/utils/ListT.hs
+++ b/compiler/utils/ListT.hs
@@ -29,9 +29,12 @@ module ListT (
fold
) where
+import GhcPrelude
+
import Control.Applicative
import Control.Monad
+import Control.Monad.Fail as MonadFail
-------------------------------------------------------------------------
-- | A monad transformer for performing backtracking computations
@@ -64,6 +67,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