packages feed

MonadCatchIO-transformers 0.2.2.0 → 0.2.2.1

raw patch · 2 files changed

+29/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

MonadCatchIO-transformers.cabal view
@@ -1,5 +1,5 @@ Name:            MonadCatchIO-transformers-Version:         0.2.2.0+Version:         0.2.2.1 Cabal-Version:   >= 1.6 License:         PublicDomain Description:
src/Control/Monad/CatchIO.hs view
@@ -54,11 +54,39 @@   block   = E.block   unblock = E.unblock +-- | Warning: this instance is somewhat contentious.+-- +-- In the same way that the @ErrorT e@ instance may fail to perform the final+-- action, due to the "early exit" behaviour of the monad, this instance+-- may perform the final action any number of times, due to the nonlinear+-- nature of the continuation monad.+-- +-- See the mailing list message+-- <http://web.archiveorange.com/archive/v/nDNOvaYx1poDHZNlmlgh>+-- for an example of what can go wrong (freeing memory twice). instance MonadCatchIO m => MonadCatchIO (ContT r m) where   m `catch` f = ContT $ \c -> runContT m c `catch` \e -> runContT (f e) c   block       = mapContT block   unblock     = mapContT unblock +-- | Warning: this instance is somewhat contentious.+-- +-- Note that in monads that fall under this instance (the most basic example+-- is @ErrorT e IO@), there are errors of two sorts:+-- +-- 1. exceptions, (i.e., exceptional values in the underlying IO monad);+-- +-- 2. error values of type @e@, introduced by the @ErrorT e@ part of the monad.+-- +-- The instance takes no special action to deal with errors of type 2.+-- In particular, 'bracket' will not perform its second argument, if+-- its third argument decides to "exit early" by throwing an error of type 2.+-- +-- This may or may not be what you want.+-- +-- See the mailing list thread starting with+-- <http://www.mail-archive.com/haskell-cafe@haskell.org/msg82859.html>+-- for some details. instance (MonadCatchIO m, Error e) => MonadCatchIO (ErrorT e m) where   m `catch` f = mapErrorT (\m' -> m' `catch` \e -> runErrorT $ f e) m   block       = mapErrorT block