zt#      !"Requires RankNTypes experimental#Bas van Dijk <v.dijk.bas@gmail.com>MonadTransControl2 is the class of monad transformers supporting an extra operation ., enabling control operations (functions that Buse monadic actions as input instead of just output) to be lifted through the transformer.  liftControl6 is used to peel off the outer layer of a transformed 1 monadic action, allowing an transformed action t m a to be  treated as a base action m a. More precisely,  liftControl captures the monadic state of t at the  point where it is bound (in t m ), yielding a function of type:  ; t = forall n o b. (Monad n, Monad o) => t n b -> n (t o b)0This function runs a transformed monadic action t n b  in the inner monad n* using the captured state, and leaves the  result t o b in the monad n after all side effects in n  have occurred. ?This can be used 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 =  $ r&un -> -- run :: t M a -> M (t M a) E foo $ run a -- uses foo :: M (t M a) -> M (t M a) An often used composition:  control = $ .  % idLiftControl acts as the "identity"  operation from a monad m to itself.  "idLiftControl f = f $ liftM return,It serves as the base case for a class like MonadControlIO, which 3allows control operations in some base monad (here IO) to be Clifted through arbitrary stacks of zero or more monad transformers in one call. For example, Control.Monad.IO.Control defines:   *class MonadIO m => MonadControlIO m where 5 liftControlIO :: (RunInBase m IO -> IO b) -> m b  !instance MonadControlIO IO where " liftControlIO = idLiftControl liftLiftControlBase 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 MonadControlIO-like class. For  example, Control.Monad.IO.Control defines:   ?instance MonadControlIO m => MonadControlIO (StateT s m) where 6 liftControlIO = liftLiftControlBase liftControlIO  using the  instance of &' s. /The following shows the recursive structure of  liftControlIO applied to a =stack of three monad transformers with IO as the base monad: t1 (t2 (t3 IO)) a:  liftControlIO  =   $   $   $    =  \f ->  $ \,run1 -> -- Capture state of t1, run1 ::  t1   $ \*run2 -> -- Capture state of t2, run2 ::  t2   $ \(run3 -> -- Capture state of t3, run3 ::  t3  let run ::  (t1 (t2 (t3 IO))) IO * run = -- Restore state  ( ($ . )j) -- :: IO ( t2 (t3 IO) (t1 (t2 (t3 IO)) a)) -> IO ( t1 (t2 (t3 IO)) a)  . ( ($ . )k) -- :: IO ( t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a))) -> IO ( t2 (t3 IO) (t1 (t2 (t3 IO)) a)) 0 -- Identity conversion  . ( ($ . )l) -- :: IO (IO (t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a)))) -> IO ( t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a)))  . ( *s -- :: IO ( t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a))) -> IO (IO (t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a)))) } -- Run (computation to run:) (inner monad:) (restore computation:)  . run3 -- :: t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a)) -> IO (t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a)))  . run2 -- :: t2 (t3 IO) (t1 (t2 (t3 IO)) a) -> t3 IO (t2 (t3 IO) (t1 (t2 (t3 IO)) a))  . run1 -- :: t1 (t2 (t3 IO)) a -> t2 (t3 IO) (t1 (t2 (t3 IO)) a)  in f run liftControlBase operation Requires RankNTypes experimental#Bas van Dijk <v.dijk.bas@gmail.com>MonadControlIO is the class of +-based monads supporting an extra operation !, enabling control operations on + to be lifted into the monad.  liftControlIO is a version of  liftControl that operates through an = arbitrary stack of monad transformers directly to an inner +  (analagously to how liftIO is a version of lift). So it can ( be used to lift control operations on + into any  monad in . For example:   foo :: + a -> + a  foo' ::  m => m a -> m a  foo' a =   $ r"unInIO -> -- runInIO :: m a -> + (m a) 4 foo $ runInIO a -- uses foo :: + (m a) -> + (m a)  An often used composition:  controlIO = $ .  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.  liftIOOp f = \g ->   $ runInIO -> f $ runInIO . 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. liftIOOp_ f = \m ->   $ runInIO -> f $ runInIO m   "non-portable (extended exceptions) experimental#Bas van Dijk <v.dijk.bas@gmail.com> Generalized version of ,-. Generalized version of .. Generalized version of /. Generalized version of 0. The computation to run ,Handler to invoke if an exception is raised Generalized version of 1. Generalized version of 2. Predicate to select exceptions Computation to run Handler Generalized version of 3. Generalized version of 4. 5Generalized version of 6. Generalized version of 7. Generalized version of 8. Generalized version of 9. Generalized version of :. Generalized version of ;. Generalized version of <. Generalized version of =. Generalized version of >.  returns True/ if asynchronous exceptions are blocked in the  current thread. Generalized version of ?. Note, any monadic side  effects in m of the "release"# computation will be discarded; it % is run only for its side effects in IO. computation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between Generalized version of @. 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 A. Note, any monadic side  effects in m of the "release" computation will be discarded. computation to run first ("acquire resource") computation to run last ("release resource") computation to run in-between !Generalized version of B. Note, any monadic side  effects in m of the " afterward" computation will be discarded. computation to run first ?computation to run afterward (even if an exception was raised) "Generalized version of C. Note, any monadic side  effects in m of the " afterward" computation will be discarded. MDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy  !"  !"   !"z      !"#$%&'(&)*+,-.,-.&)/,01&'2345&6&6&7&8&9&6&9&9&9:&9&9&7&7&7&7&7&7&7 &9!&9"&9#&9$&9%&';&9<&9=&9=&9>&9>&9?&9?&9@&9@&9A&9A&9B&9B&9C&9C&DE&8F&8F&8G&8G&8H&8H&8I&8I&8J&8K&8L&8M&8N&8O&8P&8Q&7R&7S&7T&7U&7V&7W&8X&YZ&Y[&Y[&Y\&Y]&Y^&Y_&Y_&Y`&Ya&Yb&Yc&Yd&Yefmonad-control-0.2Control.Monad.Trans.ControlControl.Monad.IO.ControlControl.Exception.Control RunInBaseRunMonadTransControl liftControlcontrol idLiftControlliftLiftControlBaseMonadControlIO liftControlIO controlIOliftIOOp liftIOOp_HandlerthrowIOioErrorcatchcatches catchJusthandle handleJusttrytryJustevaluatemaskmask_uninterruptibleMaskuninterruptibleMask_getMaskingStateblockedbracketbracket_bracketOnErrorfinally onExceptionbaseGHC.BaseMonad Control.MonadjoinliftControlNoStatetransformers-0.2.2.0Control.Monad.Trans.State.LazyStateTliftMControl.Monad.Trans.Classliftreturnghc-prim GHC.TypesIOControl.ExceptionGHC.IOGHC.IO.ExceptionControl.Exception.BasesequenceEitherassert mapExceptionPatternMatchFail RecSelError RecConError RecUpdError NoMethodErrorNonTerminationNestedAtomically GHC.Conc.SyncthrowToBlockedIndefinitelyOnMVarBlockedIndefinitelyOnSTMDeadlockAssertionFailed StackOverflow HeapOverflow ThreadKilled UserInterruptAsyncExceptionIndexOutOfBoundsUndefinedElementArrayExceptionunblockblockUnmaskedMaskedInterruptibleMaskedUninterruptible MaskingState IOException GHC.Exceptionthrow SomeException fromException toException Exception ErrorCallOverflow UnderflowLossOfPrecision DivideByZeroDenormalArithException