úÎ>¨8Ö5      !"#$%&'()*+,-./01234None CheckedException adds a phantom type parameter l to  SomeException Throws% is a type level binary relationship ( used to model a list of exceptions. .There is only one case in which the user must  add further instances to Throws. A If your sets of exceptions are hierarchical then you need to  teach  about the hierarchy.   Subtyping / As there is no way to automatically infer < the subcases of an exception, they have to be encoded = manually mirroring the hierarchy defined in the defined   instances.  For example, ) the following instance encodes that MyFileNotFoundException is  a subexception of  MyIOException :  B instance Throws MyFileNotFoundException (Caught MyIOException l) : is not a transitive relation and every ancestor relation " must be explicitly encoded.  N -- TopException I -- | I instance Throws MidException (Caught TopException l) -- | N -- MidException I instance Throws ChildException (Caught MidException l) -- | I instance Throws ChildException (Caught TopException l) -- | O -- ChildException  Note that = is automatically an ancestor of every other exception type. -A type level witness of a exception handler. 5 SomeException* is at the top of the exception hierarchy  . = Capturing SomeException captures every possible exception 67589    67589None:6;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc :NoneMonadZeroException is thrown by MonadPlus c  FailException is thrown by Monad ; 0A monad of explicitly typed, checked exceptions .UncaughtException models unchecked exceptions +In order to declare an unchecked exception E, ! all that is needed is to make e an instance of    instance UncaughtException E GNote that declaring an exception E as unchecked does not automatically S turn its children unchecked too. This is a shortcoming of the current encoding. =A Monad Transformer for explicitly typed checked exceptions. !1Run a computation explicitly handling exceptions $Run a safe computation %0Run a safe computation checking even unchecked ( ) exceptions &The throw primitive ',Rethrow an exception keeping the call trace (The catch primitive )Like ($ but makes the call trace available *CSequence two computations discarding the result of the second one. N If the first computation rises an exception, the second computation is run ' and then the exception is rethrown. +JLike finally, but performs the second computation only when the first one  rises an exception -.Capture an exception e, wrap it, and rethrow. * Keeps the original monadic call trace. /1Run a computation explicitly handling exceptions 1Run a safe computation 2+Run a computation checking even unchecked (UncaughtExceptions ) exceptions 3)This function may be used as a value for b in D / !"#$%&'()*+,acquire resource release resource  computation -./01234defghijklmnopq! !"#$%&'()*+,-./01234! !"#$%&'()*+,-./01234+ !"#$%&'()*+,-./01234defghijklmnopqNone)  !$%&'()*+,-./123)/12 !$%&'()*+,-.3 r       !"#$%%&'()*+,-./0123456789:;<=>?@A@B@C@D@EFGFH@I@JFKFLFMFNFOFPFQFRFSFTFUFVFWFXFYFZF[F\F]F^F_F`FaFbFcFdFeFfFgFhFiFjklmnopqrstuvwxycontrol-monad-exception-0.10.2Control.Monad.ExceptionControl.Monad.Exception.CatchControl.Monad.Exception.ThrowsControl.Monad.Exception.BasebaseData.Typeable.InternalTypeable GHC.Exception SomeException fromException toException ExceptiontypeOffailure-0.2.0.1Control.FailurefailureFailure monadloc-0.6Control.Monad.Loc withLocTHwithLocMonadLocCheckedExceptioncheckedExceptionThrowsCaught MonadCatchcatchcatchWithSrcLocMonadZeroException FailExceptionEMUncaughtException ParanoidMode NoExceptions AnyExceptionEMTunEMT CallTracetryEMT tryEMTWithLoc runEMT_genrunEMTrunEMTParanoidthrowrethrowfinally onExceptionbracket wrapExceptionshowExceptionWithTracetryEM tryEMWithLocrunEM runEMParanoid mplusDefaultmapLeft$fThrowseCaught$fShowCheckedException$fThrowsSomeExceptionCaught$fThrowseCaught0$fThrowseCaught1$fMonadCatcheIOIOGHC.Basefail>>=>>fmapreturn Control.MonadguardliftMMonadFunctor MonadPlusmfilterapliftM5liftM4liftM3liftM2unlesswhen replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMjoinvoidforever<=<>=>msumforM_forMfilterMmapM_mapM sequence_sequence=<<mplusmzero$fExceptionMonadZeroException$fExceptionFailException$fMonadPlusEMT $fUncaughtExceptionSomeException$fThrowseNoExceptions $fMonadFixEMT $fMonadLocEMT$fMonadCatcheEMTEMT$fMonadTransEMT $fFailureeEMT$fApplicativeEMT $fMonadEMT $fFunctorEMT$fThrowseAnyException