d]     portable experimental Anders Kaseorg <andersk@mit.edu> Safe-InferredMonadTransPeel2 is the class of monad transformers supporting an  extra operation ., enabling control operations (functions that C use monadic actions as input instead of just output) to be lifted  through the transformer. peel6 is used to peel off the outer layer of a transformed 0 monadic action, allowing an transformed action t m a to be  treated as a base action m b. More precisely, peel captures the monadic state of t at the  point where it is bound (in t n), yielding a function  t m a ->  m (t o a)2; this function runs a transformed monadic action t m  a in the base monad m* using the captured state, and leaves the  result t o a in the monad m after all side effects in m  have occurred. This can be used together with  to lift control operations  with types such as  M a -> M a into the transformed monad t M:    instance Monad M  foo :: M a -> M a  foo' :: ( t,  (t M)) => t M a -> t M a  foo' a = do  k <-  -- k :: t M a -> M (t M a)   $ 4 $ foo (k a) -- uses foo :: M (t M a) -> M (t M a) peel is typically used with  m == n == o, but is required to @ be polymorphic for greater type safety: for example, this type 2 ensures that the result of running the action in m has no  remaining side effects in m. idPeel acts as the "identity"  operation from a monad  m to itself.     =   $ !   ,It serves as the base case for a class like  MonadPeelIO, which 4 allows control operations in some base monad (here IO) to be D lifted through arbitrary stacks of zero or more monad transformers  in one call. For example, Control.Monad.IO.Peel defines   class MonadIO m => MonadPeelIO m where  peelIO :: m (m a -> " (m a))  instance MonadPeelIO " where  peelIO =  liftPeel is used to compose two  operations: the outer  provided by a % instance, and the inner provided as  the argument.  It satisfies   == . %It serves as the induction step of a  MonadPeelIO-like class. For  example, Control.Monad.IO.Peel defines   + instance MonadPeelIO m => MonadPeelIO (# s m) where  peelIO =  peelIO  using the  instance of # s. liftOp is a particular application of  that allows lifting  control operations of type (a -> m b) -> m b to   t => (a -> t m b) -> t m b.    f g = do  k <-    $  $ f (k . g) liftOp_ is a particular application of  that allows $ lifting control operations of type  m a -> m a to   m => t m a -> t m a. ,It can be thought of as a generalization of  mapReaderT,   mapStateT, etc.    f m = do  k <-    $  $ f (k m) $%&'()*+,-./$%&'()*+,-./portable experimental Anders Kaseorg <andersk@mit.edu> Safe-Inferred MonadPeelIO is the class of "-based monads supporting an  extra operation !, enabling control operations on " to be  lifted into the monad. peelIO is a version of  that operates through an < arbitrary stack of monad transformers directly to an inner "  (analagously to how 0 is a version of lift). So it can  be used with 0 to lift control operations on " into any  monad in . For example:    foo :: " a -> " a  foo' ::  m => m a -> m a  foo' a = do  k <-  -- k :: m a -> IO (m a)   $ 0 $ foo (k a) -- uses foo :: " (m a) -> " (m a) Note that the "obvious" term of this type ( peelIO =     ) does not work correctly. Instances of   should be constructed via , using  peelIO =   peelIO. liftIOOp is a particular application of  that allows $ lifting control operations of type (a -> " b) -> " b  (e.g. alloca,  withMVar v) to  m => (a -> m b) ->  m b.    f g = do  k <-    $ 0 $ f (k . g)   liftIOOp_ is a particular application of  that allows $ lifting control operations of type " a -> " a  (e.g. block) to  m => m a -> m a.     f m = do  k <-    $ 0 $ f (k m)  123456789:;<   123456789:;<"non-portable (extended exceptions) experimental Anders Kaseorg <andersk@mit.edu> Safe-Inferred Generalized version of =. Generalized version of >. Generalized version of ?. Generalized version of @. Generalized version of A. Generalized version of B. Generalized version of C. Generalized version of D. Generalized version of E. Generalized version of F. Generalized version of G. Generalized version of H. Generalized version of I. Generalized version of J. Note, any monadic side  effects in m of the "release"# computation will be discarded; it % is run only for its side effects in IO. Generalized version of K. Note, any monadic side  effects in m of both the "acquire" and "release" C computations will be discarded. To keep the monadic side effects  of the "acquire" computation, use  with constant  functions instead. Generalized version of L. Generalized version of M. Note, any monadic side  effects in m of the " afterward" computation will be discarded. Generalized version of N.  The computation to run ,Handler to invoke if an exception is raised Predicate to select exceptions Computation to run Handler Ocomputation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between computation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between computation to run first ?computation to run afterward (even if an exception was raised) NPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     O      !"#$%#&'#$(#&)*+, -./0123456789: ;<=>?@ABCDEFGH#I#J#K#L#L#I#L#L#L#L#J#J#J#L#L#L#L#LM#$N#IO#LP#LQ#LQ#LR#LR#LS#LS#LT#LT#LU#LU#LV#LV#LW#LW#XY#KZ#KZ#K[#K[#K\#K\#K]#K]#K^#K_#K`#Ka#Kb#Kc#Kd#Ke#Jf#Jg#Jh#Ji#Jj#Jk#Jl#Jm#Jn#Ko#pq#pr#pr#ps#pt#pu#pv#pv#pw#px#py#pz#p{#p|#p}~monad-peel-0.1.1Control.Monad.Trans.PeelControl.Monad.IO.PeelControl.Exception.PeelMonadTransPeelpeelidPeelliftPeelliftOpliftOp_ MonadPeelIOpeelIOliftIOOp liftIOOp_HandlerthrowIOioErrorcatch catchJustcatcheshandle handleJusttrytryJustevaluateblockunblockbracketbracket_bracketOnErrorfinally onExceptiontransformers-0.3.0.0Control.Monad.Trans.ClassliftbaseGHC.BaseMonad Control.MonadjoinreturnliftMghc-prim GHC.TypesIOControl.Monad.Trans.State.LazyStateTliftList$fMonadTransPeelRWST$fMonadTransPeelRWST0$fMonadTransPeelWriterT$fMonadTransPeelWriterT0$fMonadTransPeelStateT$fMonadTransPeelStateT0$fMonadTransPeelReaderT$fMonadTransPeelErrorT$fMonadTransPeelMaybeT$fMonadTransPeelListT$fMonadTransPeelIdentityTControl.Monad.IO.ClassliftIO$fMonadPeelIORWST$fMonadPeelIORWST0$fMonadPeelIOWriterT$fMonadPeelIOWriterT0$fMonadPeelIOStateT$fMonadPeelIOStateT0$fMonadPeelIOReaderT$fMonadPeelIOErrorT$fMonadPeelIOMaybeT$fMonadPeelIOListT$fMonadPeelIOIdentityT$fMonadPeelIOIOControl.ExceptionGHC.IOGHC.IO.ExceptionControl.Exception.BasesequenceEitherassertallowInterrupt mapExceptionPatternMatchFail RecSelError RecConError RecUpdError NoMethodErrorNonTerminationNestedAtomically GHC.Conc.SyncthrowToBlockedIndefinitelyOnMVarBlockedIndefinitelyOnSTMDeadlockAssertionFailed StackOverflow HeapOverflow ThreadKilled UserInterruptAsyncExceptionIndexOutOfBoundsUndefinedElementArrayExceptionuninterruptibleMaskuninterruptibleMask_maskmask_getMaskingStateUnmaskedMaskedInterruptibleMaskedUninterruptible MaskingState IOException GHC.Exceptionthrow SomeException fromException toException Exception ErrorCallOverflow UnderflowLossOfPrecision DivideByZeroDenormalRatioZeroDenominatorArithException