From cbbeb3b7f6538eb20518ed976ce0879af71dca56 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 5 May 2014 21:20:26 +0300 Subject: [PATCH] exceptions 0.6 --- yesod-core/Yesod/Core/Types.hs | 9 +++++++++ yesod-core/yesod-core.cabal | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/yesod-core/Yesod/Core/Types.hs b/yesod-core/Yesod/Core/Types.hs index be73cad3..7e3fd0dd 100644 --- a/yesod-core/Yesod/Core/Types.hs +++ b/yesod-core/Yesod/Core/Types.hs @@ -17,6 +17,9 @@ import Control.Exception (Exception) import Control.Monad (liftM, ap) import Control.Monad.Base (MonadBase (liftBase)) import Control.Monad.Catch (MonadCatch (..)) +#if MIN_VERSION_exceptions(0,6,0) +import Control.Monad.Catch (MonadMask (..)) +#endif import Control.Monad.IO.Class (MonadIO (liftIO)) import Control.Monad.Logger (LogLevel, LogSource, MonadLogger (..)) @@ -419,6 +422,9 @@ instance MonadThrow m => MonadThrow (WidgetT site m) where instance MonadCatch m => MonadCatch (HandlerT site m) where catch (HandlerT m) c = HandlerT $ \r -> m r `catch` \e -> unHandlerT (c e) r +#if MIN_VERSION_exceptions(0,6,0) +instance MonadMask m => MonadMask (HandlerT site m) where +#endif mask a = HandlerT $ \e -> mask $ \u -> unHandlerT (a $ q u) e where q u (HandlerT b) = HandlerT (u . b) uninterruptibleMask a = @@ -426,6 +432,9 @@ instance MonadCatch m => MonadCatch (HandlerT site m) where where q u (HandlerT b) = HandlerT (u . b) instance MonadCatch m => MonadCatch (WidgetT site m) where catch (WidgetT m) c = WidgetT $ \r -> m r `catch` \e -> unWidgetT (c e) r +#if MIN_VERSION_exceptions(0,6,0) +instance MonadMask m => MonadMask (WidgetT site m) where +#endif mask a = WidgetT $ \e -> mask $ \u -> unWidgetT (a $ q u) e where q u (WidgetT b) = WidgetT (u . b) uninterruptibleMask a = diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index 0b83db47..c3b35da3 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 1.2.15 +version: 1.2.15.1 license: MIT license-file: LICENSE author: Michael Snoyman