exceptions 0.10.11 → 0.10.12
raw patch · 4 files changed
+30/−7 lines, 4 filesdep ~QuickCheckdep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: QuickCheck, template-haskell
API changes (from Hackage documentation)
+ Control.Monad.Catch: instance (Control.Monad.Catch.MonadCatch m, GHC.Base.Monoid w) => Control.Monad.Catch.MonadCatch (Control.Monad.Trans.Accum.AccumT w m)
+ Control.Monad.Catch: instance (Control.Monad.Catch.MonadMask m, GHC.Base.Monoid w) => Control.Monad.Catch.MonadMask (Control.Monad.Trans.Accum.AccumT w m)
+ Control.Monad.Catch: instance (GHC.Base.Monoid w, Control.Monad.Catch.MonadThrow m) => Control.Monad.Catch.MonadThrow (Control.Monad.Trans.Accum.AccumT w m)
Files
- CHANGELOG.markdown +6/−0
- exceptions.cabal +5/−5
- src/Control/Monad/Catch.hs +18/−1
- src/Control/Monad/Catch/Pure.hs +1/−1
CHANGELOG.markdown view
@@ -1,3 +1,9 @@+0.10.12 [2026.01.10]+--------------------+* Add `Monad{Throw,Catch,Mask}` instances for `AccumT` when building with+ `transformers-0.5.6` or later.+* Remove unused `template-haskell` dependency in the test suite.+ 0.10.11 [2025.10.13] -------------------- * Add a `rethrowM` method to the `MonadThrow` class and a `catchNoPropagate`
exceptions.cabal view
@@ -1,6 +1,6 @@ name: exceptions category: Control, Exceptions, Monad-version: 0.10.11+version: 0.10.12 cabal-version: >= 1.10 license: BSD3 license-file: LICENSE@@ -21,10 +21,11 @@ , GHC == 9.0.2 , GHC == 9.2.8 , GHC == 9.4.8- , GHC == 9.6.6+ , GHC == 9.6.7 , GHC == 9.8.4- , GHC == 9.10.1- , GHC == 9.12.1+ , GHC == 9.10.3+ , GHC == 9.12.2+ , GHC == 9.14.1 synopsis: Extensible optionally-pure exceptions description: Extensible optionally-pure exceptions. @@ -70,7 +71,6 @@ exceptions, mtl, stm,- template-haskell, transformers >= 0.5.2.0 && < 0.7, tasty >= 1.4 && < 1.6, tasty-hunit >= 0.10 && < 0.11,
src/Control/Monad/Catch.hs view
@@ -100,6 +100,10 @@ import Language.Haskell.TH.Syntax (Q) #endif +#if MIN_VERSION_transformers(0,5,6)+import Control.Monad.Trans.Accum (AccumT (..), runAccumT, evalAccumT)+#endif+ #if !MIN_VERSION_transformers(0,6,0) import Control.Monad.Trans.Error (ErrorT(..), Error, runErrorT) import Control.Monad.Trans.List (ListT(..), runListT)@@ -238,7 +242,7 @@ -- library. Previously, implementation of functions like 'bracket' -- and 'finally' in this module were based on the 'mask' and -- 'uninterruptibleMask' functions only, disallowing some classes of- -- tranformers from having @MonadMask@ instances (notably+ -- transformers from having @MonadMask@ instances (notably -- multi-exit-point transformers like 'ExceptT'). If you are a -- library author, you'll now need to provide an implementation for -- this method. The @StateT@ implementation demonstrates most of the@@ -711,6 +715,19 @@ throwM = lift . throwM -- I don't believe any valid of MonadCatch exists for ContT. -- instance MonadCatch m => MonadCatch (ContT r m) where++#if MIN_VERSION_transformers(0,5,6)+instance (Monoid w, MonadThrow m) => MonadThrow (AccumT w m) where+ throwM = lift . throwM++instance (MonadCatch m, Monoid w) => MonadCatch (AccumT w m) where+ catch (AccumT m) f = AccumT $ \w -> catch (m w) $ \e -> runAccumT (f e) w++instance (MonadMask m, Monoid w) => MonadMask (AccumT w m) where+ mask f = AccumT $ \w -> mask $ \g -> flip runAccumT w $ f $ \(AccumT m) -> AccumT $ \w' -> g $ m w'+ uninterruptibleMask f = AccumT $ \w -> uninterruptibleMask $ \g -> flip runAccumT w $ f $ \(AccumT m) -> AccumT $ \w' -> g $ m w'+ generalBracket m f g = AccumT $ \w -> (\(b, (c, w')) -> ((b, c), w')) <$> generalBracket (runAccumT m w) (\(a, w') exitCase -> runAccumT (f a exitCase) (w <> w')) (\(a, w') -> evalAccumT (g a) (w <> w'))+#endif #if !MIN_VERSION_transformers(0,6,0) -- | Throws exceptions into the base monad.
src/Control/Monad/Catch/Pure.hs view
@@ -61,7 +61,7 @@ ------------------------------------------------------------------------------ -- $transformer--- The @transformers@-style monad transfomer+-- The @transformers@-style monad transformer ------------------------------------------------------------------------------ -- | Add 'Exception' handling abilities to a 'Monad'.