Gc?     Bas van Dijk, Anders Kaseorg BSD-style#Bas van Dijk <v.dijk.bas@gmail.com> experimental Trustworthy 2468=HKM7Handy type synonym that composes the monadic states of t and m.It can be used to define the  for new  instances.A function that runs a m8 computation on the monadic state that was captured by A  RunInBase m4 function yields a computation in the base monad of m$ that returns the monadic state of m/. This state can later be used to restore the m computation using .Monadic state of m. liftBaseWith is similar to liftIO and liftBase? in that it lifts a base computation to the constructed monad.-Instances should satisfy similar laws as the MonadIO and  laws: &liftBaseWith . const . return = return TliftBaseWith (const (m >>= f)) = liftBaseWith (const m) >>= liftBaseWith . const . fThe difference with liftBase. is that before lifting the base computation  liftBaseWith captures the state of m0. It then provides the base computation with a  function that allows running m7 computations in the base monad on the captured state. Construct a m' computation from the monadic state of m that is returned from a  function.Instances should satisfy: 9liftBaseWith (\runInBase -> runInBase m) >>= restoreM = m)A function that runs a transformed monad t n, on the monadic state that was captured by  A Run t" function yields a computation in n$ that returns the monadic state of t,. This state can later be used to restore a t computation using  .Monadic state of t. liftWith is similar to liftR in that it lifts a computation from the argument monad to the constructed monad.-Instances should satisfy similar laws as the  laws: "liftWith . const . return = return HliftWith (const (m >>= f)) = liftWith (const m) >>= liftWith . const . fThe difference with lift is that before lifting the m computation liftWith captures the state of t. It then provides the m computation with a  function that allows running t n computations in n (for all n) on the captured state.  Construct a t' computation from the monadic state of t that is returned from a  function.Instances should satisfy: 2liftWith (\run -> run t) >>= restoreT . return = t Default definition for the   method. Default defintion for the  method.Note that it composes a   of t with a  of m to give a  of t m:  defaultLiftBaseWith stM = \f ->  - $ \run -> U $ \runInBase -> f $ liftM stM . runInBase . run Default definition for the  method. Note that: defaultRestoreM unStM =   .  . unStMAn often used composition:  control f =  f >>=  liftBaseOp is a particular application of 1 that allows lifting control operations of type:((a -> b c) -> b c) to: ( b m => (a -> m c) -> m c). For example: liftBaseOp alloca ::   m => (Ptr a -> m c) -> m c liftBaseOp_ is a particular application of 1 that allows lifting control operations of type: (b a -> b a) to: ( b m => m a -> m a). For example: liftBaseOp_ mask_ ::   m => m a -> m aliftBaseDiscard is a particular application of 1 that allows lifting control operations of type: (b () -> b a) to: ( b m => m () -> m a).*Note that, while the argument computation m ()< has access to the captured state, all its side-effects in mG are discarded. It is run only for its side-effects in the base monad b. For example: liftBaseDiscard forkIO ::   m => m () -> m ThreadId  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN Monad constructorMonad deconstructor constructor Monad constructor deconstructor  constructor deconstructorOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~    . PORQTSVUXWZY !\["#^]$%`_&'ba()dc*+fe,-hg.ji/lk0nm1po2rq3ts4vu5xw6zy78|{9:~};<=>?@ABCDEFGHIJKLMN      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~monad-control-0.3.3.1Control.Monad.Trans.Control ComposeSt RunInBaseMonadBaseControlStM liftBaseWithrestoreMRunMonadTransControlStTliftWithrestoreTdefaultLiftWithdefaultRestoreTdefaultLiftBaseWithdefaultRestoreMcontrol liftBaseOp liftBaseOp_liftBaseDiscardtransformers-base-0.4.4Control.Monad.Base MonadBasetransformers-0.4.2.0Control.Monad.Trans.Class MonadTransghc-prim GHC.TypesIOStMRWSunStMRWSStMRWSS unStMRWSS StMWriter unStMWriter StMWriterS unStMWriterSStMError unStMError StMExcept unStMExceptStMState unStMState StMStateS unStMStateS StMReader unStMReaderStMList unStMListStMMaybe unStMMaybeStMIdunStMIdStSTStSTSStSTMStIStFStLStEStStIOStRWS'unStRWS'StRWSunStRWS StWriter' unStWriter'StWriter unStWriterStState' unStState'StState unStStateStReader unStReaderStListunStListStExcept unStExceptStError unStErrorStMaybe unStMaybeStIdunStIdTFCo:R:StMRWSTa$fMonadBaseControlbRWSTTFCo:R:StMRWSTa0$fMonadBaseControlbRWST0TFCo:R:StMWriterTa$fMonadBaseControlbWriterTTFCo:R:StMWriterTa0$fMonadBaseControlbWriterT0TFCo:R:StMErrorTa$fMonadBaseControlbErrorTTFCo:R:StMExceptTa$fMonadBaseControlbExceptTTFCo:R:StMStateTa$fMonadBaseControlbStateTTFCo:R:StMStateTa0$fMonadBaseControlbStateT0TFCo:R:StMReaderTa$fMonadBaseControlbReaderTTFCo:R:StMListTa$fMonadBaseControlbListTTFCo:R:StMMaybeTa$fMonadBaseControlbMaybeTTFCo:R:StMIdentityTa$fMonadBaseControlbIdentityT TFCo:R:StMSTa$fMonadBaseControlSTSTTFCo:R:StMSTa0$fMonadBaseControlSTST0TFCo:R:StMSTMa$fMonadBaseControlSTMSTMTFCo:R:StMIdentitya"$fMonadBaseControlIdentityIdentityTFCo:R:StM(->)a$fMonadBaseControl(->)(->) TFCo:R:StM[]a$fMonadBaseControl[][]TFCo:R:StMEithera$fMonadBaseControlEitherEitherTFCo:R:StMMaybea$fMonadBaseControlMaybeMaybe TFCo:R:StMIOa$fMonadBaseControlIOIOTFCo:R:StTRWSTa$fMonadTransControlRWSTTFCo:R:StTRWSTa0$fMonadTransControlRWST0TFCo:R:StTWriterTa$fMonadTransControlWriterTTFCo:R:StTWriterTa0$fMonadTransControlWriterT0TFCo:R:StTStateTa$fMonadTransControlStateTTFCo:R:StTStateTa0$fMonadTransControlStateT0TFCo:R:StTReaderTa$fMonadTransControlReaderTTFCo:R:StTListTa$fMonadTransControlListTTFCo:R:StTExceptTa$fMonadTransControlExceptTTFCo:R:StTErrorTa$fMonadTransControlErrorTTFCo:R:StTMaybeTa$fMonadTransControlMaybeTTFCo:R:StTIdentityTa$fMonadTransControlIdentityT