diff --git a/exceptions.cabal b/exceptions.cabal index e6dfac592bf7df943246194a0086a96191d18c08..f2dad4a45f2244448b808f425d5608acce6703c8 100644 --- a/exceptions.cabal +++ b/exceptions.cabal @@ -36,6 +36,7 @@ library base >= 4.3 && < 5, stm >= 2.2 && < 3, transformers >= 0.2 && < 0.5, + transformers-compat >= 0.3 && < 0.5, mtl >= 2.0 && < 2.3 exposed-modules: diff --git a/src/Control/Monad/Catch.hs b/src/Control/Monad/Catch.hs index 262e3a487e47b783b80707fff5eee9558d2bd060..1377a870c11066ce8124dc9bf274a92afc691993 100644 --- a/src/Control/Monad/Catch.hs +++ b/src/Control/Monad/Catch.hs @@ -92,9 +92,7 @@ import Control.Monad.STM (STM) import Control.Monad.Trans.List (ListT(..), runListT) import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT) import Control.Monad.Trans.Error (ErrorT(..), Error, runErrorT) -#if MIN_VERSION_transformers(0,4,0) import Control.Monad.Trans.Except (ExceptT(..), runExceptT) -#endif import Control.Monad.Trans.Cont (ContT) import Control.Monad.Trans.Identity import Control.Monad.Reader as Reader @@ -320,14 +318,12 @@ instance (Error e, MonadThrow m) => MonadThrow (ErrorT e m) where instance (Error e, MonadCatch m) => MonadCatch (ErrorT e m) where catch (ErrorT m) f = ErrorT $ catch m (runErrorT . f) -#if MIN_VERSION_transformers(0,4,0) -- | Throws exceptions into the base monad. instance MonadThrow m => MonadThrow (ExceptT e m) where throwM = lift . throwM -- | Catches exceptions from the base monad. instance MonadCatch m => MonadCatch (ExceptT e m) where catch (ExceptT m) f = ExceptT $ catch m (runExceptT . f) -#endif instance MonadThrow m => MonadThrow (ContT r m) where throwM = lift . throwM