úÎe_i'      !"#$%&0(C) Edward Kmett 2013-2015, (c) Google Inc. 2012 BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portable Trustworthy 246:=BHKM!Generalized version of 'ÂA class for monads which provide for the ability to account for all possible exit points from a computation, and to mask asynchronous exceptions. Continuation-based monads, and stacks such as  ErrorT e IOQ which provide for multiple failure modes, are invalid instances of this class.Note that this package does provide a  MonadMask instance for CatchT. This instance is onlyU valid if the base monad provides no ability to provide multiple exit. For example, IO or Either$ would be invalid base monads, but Reader or State would be acceptable.4Instances should ensure that, in the following code:  f `finally` g The action g, is called regardless of what occurs within f, including async exceptions.“Runs an action with asynchronous exceptions disabled. The action is provided a method for restoring the async. environment to what it was at the  call. See Control.Exception's (. Like 8, but the masked computation is not interruptible (see Control.Exception's )þ. WARNING: Only use if you need to mask exceptions around an interruptible operation AND you can guarantee the interruptible operation will only block for a short period of time. Otherwise you render the program/thread unresponsive and/or unkillable. gA class for monads which allow exceptions to be caught, in particular exceptions which were thrown by  .(Instances should obey the following law: catch (throwM e) f = f e1Note that the ability to catch an exception does notÄ guarantee that we can deal with all possible exit points from a computation. Some monads, such as continuation-based stacks, allow for more than just a success/failure strategy, and therefore catch cannotC be used by those monads to properly implement a function such as finally. For more information, see . ºProvide a handler for exceptions thrown during execution of the first action. Note that type of the type of the argument to the handler will constrain which exceptions are caught. See Control.Exception's *. 5A class for monads in which exceptions may be thrown.(Instances should obey the following law: throwM e >> x = throwM eZIn other words, throwing an exception short-circuits the rest of the monadic computation. PThrow an exception. Note that this throws when this action is run in the monad m5, not when it is applied. It is a generalization of Control.Exception's +.Should satisfy the law: throwM e >> f = throwM eLike , but does not pass a restore action to the argument.Like  , but does not pass a restore action to the argument.lCatches all exceptions, and somewhat defeats the purpose of the extensible exception system. Use sparingly. Catch all , (eqv.  IOExceptionA) exceptions. Still somewhat too general, but better than using . See ' for an easy way of catching specific ,s based on the predicates in System.IO.Error.aCatch exceptions only if they pass some predicate. Often useful with the predicates for testing , values in System.IO.Error.MA more generalized way of determining which exceptions to catch at run time.Flipped  . See Control.Exception's -.Flipped Flipped Flipped Flipped . See Control.Exception's .. Similar to  , but returns an / result. See Control.Exception's . A variant of O that takes an exception predicate to select which exceptions are caught. See Control.Exception's 0+Catches different sorts of exceptions. See Control.Exception's 1oRun an action only if an exception is thrown in the main action. The exception is not caught, simply rethrown.ÿ Generalized abstracted pattern of safe resource acquisition and release in the face of exceptions. The first action "acquires" some value, which is "released" by the second action at the end. The third action "uses" the value and its result is the result of the .cIf an exception occurs during the use, the release still happens before the exception is rethrown. Version of A without any value being passed to the second and third actions.TPerform an action with a finalizer action that is run, even if an exception occurs. Like e, but only performs the final action if there was an exception raised by the in-between computation.2'Catches exceptions from the base monad.3&Throws exceptions into the base monad.4'Catches exceptions from the base monad.5&Throws exceptions into the base monad.6'Catches exceptions from the base monad.7&Throws exceptions into the base monad.F  89234567:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[!  !   A    89234567:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[0(C) Edward Kmett 2013-2015, (c) Google Inc. 2012 BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portable Trustworthy 246:BHM"Add  handling abilities to a \. This should never be used in combination with ] . Think of "\ as an alternative base monad for use with mocking code that solely throws exceptions via  . Note: that ]0 monad has these abilities already, so stacking "D on top of it does not add any value and can possibly be confusing:I(error "Hello!" :: IO ()) `catch` (\(e :: ErrorCall) -> liftIO $ print e)Hello!\runCatchT $ (error "Hello!" :: CatchT IO ()) `catch` (\(e :: ErrorCall) -> liftIO $ print e)*** Exception: Hello!irunCatchT $ (throwM (ErrorCall "Hello!") :: CatchT IO ()) `catch` (\(e :: ErrorCall) -> liftIO $ print e)Hello!&7Map the unwrapped computation using the given function. $ (& f m) = f ($ m)^SNote: This instance is only valid if the underlying monad has a single exit point!!"#$%&_`ab^cdefghijklmn'  !"#$%&"#$!%&!"#$%&_`ab^cdefghijklmno       !"#$%&&'() * *+*,-.++/0+123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqexceptions-0.8.0.1Control.Monad.CatchControl.Monad.Catch.PureControl.Exceptiontrybase GHC.Exception SomeException fromException toException ExceptionHandler MonadMaskmaskuninterruptibleMask MonadCatchcatch MonadThrowthrowMmask_uninterruptibleMask_catchAll catchIOErrorcatchIf catchJusthandle handleIOError handleAllhandleIf handleJusttryJustcatches onExceptionbracketbracket_finallybracketOnErrorCatchCatchT runCatchTrunCatch mapCatchTGHC.IOControl.Exception.BasethrowIOGHC.IO.ExceptionIOError Data.EitherEither$fMonadCatchExceptT$fMonadThrowExceptT$fMonadCatchErrorT$fMonadThrowErrorT$fMonadCatchMaybeT$fMonadThrowMaybeT$fFunctorHandler$fMonadThrowContT$fMonadCatchListT$fMonadThrowListT$fMonadMaskRWST$fMonadCatchRWST$fMonadThrowRWST$fMonadMaskRWST0$fMonadCatchRWST0$fMonadThrowRWST0$fMonadMaskWriterT$fMonadCatchWriterT$fMonadThrowWriterT$fMonadMaskWriterT0$fMonadCatchWriterT0$fMonadThrowWriterT0$fMonadMaskReaderT$fMonadCatchReaderT$fMonadThrowReaderT$fMonadMaskStateT$fMonadCatchStateT$fMonadThrowStateT$fMonadMaskStateT0$fMonadCatchStateT0$fMonadThrowStateT0$fMonadMaskIdentityT$fMonadCatchIdentityT$fMonadThrowIdentityT$fMonadCatchSTM$fMonadThrowSTM $fMonadMaskIO$fMonadCatchIO$fMonadThrowIO$fMonadThrowEither$fMonadThrowMaybe$fMonadThrow[]GHC.BaseMonadghc-prim GHC.TypesIO$fMonadMaskCatchT$fMonadRWSrwsCatchT$fMonadWriterwCatchT$fMonadReadereCatchT$fMonadStatesCatchT$fMonadCatchCatchT$fMonadThrowCatchT$fMonadIOCatchT$fMonadTransCatchT$fMonadPlusCatchT$fAlternativeCatchT$fTraversableCatchT$fFoldableCatchT$fMonadFixCatchT $fMonadCatchT$fApplicativeCatchT$fFunctorCatchT