-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Ad-hoc type classes for lifting
--   
--   This simple and lightweight library provides type classes for lifting
--   monad transformer operations.
@package transformers-lift
@version 0.2.0.1


-- | Lifting the <tt>local</tt> operation.
module Control.Monad.Trans.Lift.Local

-- | The class of monad transformers capable of lifting <tt>local</tt>.
class MonadTrans t => LiftLocal t

-- | Lift the <tt>local</tt> operation.
liftLocal :: (LiftLocal t, Monad m) => m r -> (forall a. Local r m a) -> (forall a. Local r (t m) a)

-- | Signature of the <tt>local</tt> operation, introduced in
--   <a>Control.Monad.Trans.Reader</a>.
type Local r m a = (r -> r) -> m a -> m a

-- | Default definition for the <a>liftLocal</a> method.
defaultLiftLocal :: (Monad m, LiftLocal n) => (forall x. n m x -> t m x) -> (forall o x. t o x -> n o x) -> m r -> (forall a. Local r m a) -> (forall a. Local r (t m) a)
instance Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.Cont.ContT r)
instance Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.Except.ExceptT e)
instance Control.Monad.Trans.Lift.Local.LiftLocal Control.Monad.Trans.Identity.IdentityT
instance Control.Monad.Trans.Lift.Local.LiftLocal Control.Monad.Trans.List.ListT
instance Control.Monad.Trans.Lift.Local.LiftLocal Control.Monad.Trans.Maybe.MaybeT
instance Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.Reader.ReaderT r)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.RWS.Lazy.RWST r w s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.RWS.Strict.RWST r w s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.RWS.CPS.Internal.RWST r w s)
instance Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.State.Lazy.StateT s)
instance Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.State.Strict.StateT s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.Writer.Lazy.WriterT w)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.Writer.Strict.WriterT w)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Local.LiftLocal (Control.Monad.Trans.Writer.CPS.Internal.WriterT w)


-- | The <a>StT</a> type family.
module Control.Monad.Trans.Lift.StT

-- | Internal state of a monad transformer. Same as <tt>StT</tt> from the
--   <tt>monad-control</tt> package.


-- | Lifting the <tt>pass</tt> operation.
module Control.Monad.Trans.Lift.Pass

-- | The class of monad transformers capable of lifting <tt>pass</tt>.
class MonadTrans t => LiftPass t

-- | Lift the <tt>pass</tt> operation. Should satisfy the uniformity
--   property
--   
--   <ul>
--   <li><pre><a>lift</a> . <a>liftPass</a> = <a>liftPass</a> .
--   <a>lift</a></pre></li>
--   </ul>
liftPass :: (LiftPass t, Monad m) => Pass w m (StT t a) -> Pass w (t m) a

-- | Signature of the <tt>pass</tt> operation, introduced in
--   <a>Control.Monad.Trans.Writer</a>. Any lifting function
--   <tt>liftPass</tt> should satisfy
--   
--   <ul>
--   <li><pre><tt>lift</tt> . liftPass = liftPass .
--   <tt>lift</tt></pre></li>
--   </ul>
type Pass w (m :: * -> *) a = m (a, w -> w) -> m a

-- | Default definition for the <a>liftPass</a> method.
defaultLiftPass :: (Monad m, LiftPass n) => (forall x. n m x -> t m x) -> (forall o x. t o x -> n o x) -> Pass w m (StT n a) -> Pass w (t m) a
instance Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.Except.ExceptT e)
instance Control.Monad.Trans.Lift.Pass.LiftPass Control.Monad.Trans.Identity.IdentityT
instance Control.Monad.Trans.Lift.Pass.LiftPass Control.Monad.Trans.Maybe.MaybeT
instance Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.Reader.ReaderT r)
instance Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.State.Lazy.StateT s)
instance Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.State.Strict.StateT s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.RWS.Lazy.RWST r w' s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.RWS.Strict.RWST r w' s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.RWS.CPS.Internal.RWST r w' s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.Writer.Lazy.WriterT w')
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.Writer.Strict.WriterT w')
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Pass.LiftPass (Control.Monad.Trans.Writer.CPS.Internal.WriterT w')


-- | Lifting the <tt>listen</tt> operation.
module Control.Monad.Trans.Lift.Listen

-- | The class of monad transformers capable of lifting <tt>listen</tt>.
class MonadTrans t => LiftListen t

-- | Lift the <tt>listen</tt> operation. Should satisfy the uniformity
--   property
--   
--   <ul>
--   <li><pre><a>lift</a> . <a>liftListen</a> = <a>liftListen</a> .
--   <a>lift</a></pre></li>
--   </ul>
liftListen :: (LiftListen t, Monad m) => Listen w m (StT t a) -> Listen w (t m) a

-- | Signature of the <tt>listen</tt> operation, introduced in
--   <a>Control.Monad.Trans.Writer</a>. Any lifting function
--   <tt>liftListen</tt> should satisfy
--   
--   <ul>
--   <li><pre><tt>lift</tt> . liftListen = liftListen .
--   <tt>lift</tt></pre></li>
--   </ul>
type Listen w (m :: * -> *) a = m a -> m (a, w)

-- | Default definition for the <a>liftListen</a> method.
defaultLiftListen :: (Monad m, LiftListen n) => (forall x. n m x -> t m x) -> (forall o x. t o x -> n o x) -> Listen w m (StT n a) -> Listen w (t m) a
instance Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.Except.ExceptT e)
instance Control.Monad.Trans.Lift.Listen.LiftListen Control.Monad.Trans.Identity.IdentityT
instance Control.Monad.Trans.Lift.Listen.LiftListen Control.Monad.Trans.Maybe.MaybeT
instance Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.Reader.ReaderT r)
instance Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.State.Lazy.StateT s)
instance Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.State.Strict.StateT s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.RWS.Lazy.RWST r w' s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.RWS.Strict.RWST r w' s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.RWS.CPS.Internal.RWST r w' s)
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.Writer.Lazy.WriterT w')
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.Writer.Strict.WriterT w')
instance GHC.Base.Monoid w' => Control.Monad.Trans.Lift.Listen.LiftListen (Control.Monad.Trans.Writer.CPS.Internal.WriterT w')


-- | Lifting the <tt>catch</tt> operation.
module Control.Monad.Trans.Lift.Catch

-- | The class of monad transformers capable of lifting <tt>catch</tt>.
class MonadTrans t => LiftCatch t

-- | Lift the <tt>catch</tt> operation. Should satisfy the uniformity
--   property
--   
--   <ul>
--   <li><pre><a>lift</a> (cf m f) = <a>liftCatch</a> (<a>lift</a> . cf)
--   (<a>lift</a> f)</pre></li>
--   </ul>
liftCatch :: (LiftCatch t, Monad m) => Catch e m (StT t a) -> Catch e (t m) a

-- | Signature of the <tt>catchE</tt> operation, introduced in
--   <a>Control.Monad.Trans.Except</a>. Any lifting function
--   <tt>liftCatch</tt> should satisfy
--   
--   <ul>
--   <li><pre><tt>lift</tt> (cf m f) = liftCatch (<tt>lift</tt> . cf)
--   (<tt>lift</tt> f)</pre></li>
--   </ul>
type Catch k e (m :: k -> *) (a :: k) = m a -> (e -> m a) -> m a

-- | Default definition for the <a>liftCatch</a> method.
defaultLiftCatch :: (Monad m, LiftCatch n) => (forall x. n m x -> t m x) -> (forall o x. t o x -> n o x) -> Catch e m (StT n a) -> Catch e (t m) a
instance Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.Except.ExceptT e)
instance Control.Monad.Trans.Lift.Catch.LiftCatch Control.Monad.Trans.Identity.IdentityT
instance Control.Monad.Trans.Lift.Catch.LiftCatch Control.Monad.Trans.List.ListT
instance Control.Monad.Trans.Lift.Catch.LiftCatch Control.Monad.Trans.Maybe.MaybeT
instance Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.Reader.ReaderT r)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.RWS.Lazy.RWST r w s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.RWS.Strict.RWST r w s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.RWS.CPS.Internal.RWST r w s)
instance Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.State.Lazy.StateT s)
instance Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.State.Strict.StateT s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.Writer.Lazy.WriterT w)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.Writer.Strict.WriterT w)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.Catch.LiftCatch (Control.Monad.Trans.Writer.CPS.Internal.WriterT w)


-- | Lifting the <tt>callCC</tt> operation.
module Control.Monad.Trans.Lift.CallCC

-- | The class of monad transformers capable of lifting <tt>callCC</tt>.
class MonadTrans t => LiftCallCC t

-- | Lift the <tt>callCC</tt> operation. Should satisfy the uniformity
--   property
--   
--   <ul>
--   <li><pre><a>lift</a> (f k) = f' (<a>lift</a> . k) =&gt; <a>lift</a>
--   (cf f) = <a>liftCallCC</a> cf f'</pre></li>
--   </ul>
liftCallCC :: (LiftCallCC t, Monad m) => CallCC m (StT t a) (StT t b) -> CallCC (t m) a b

-- | Lift the <tt>callCC</tt> operation. This is an alternative version of
--   <a>liftCallCC</a> included for historical reasons. It has a different
--   lifting behavior for the <tt>StateT</tt> and <tt>RWST</tt> monad
--   transformers. Matches what <tt>mtl</tt> does but doesn't satisfy the
--   uniformity property.
liftCallCC' :: (LiftCallCC t, Monad m) => CallCC m (StT t a) (StT t b) -> CallCC (t m) a b

-- | Signature of the <tt>callCC</tt> operation, introduced in
--   <a>Control.Monad.Trans.Cont</a>. Any lifting function
--   <tt>liftCallCC</tt> should satisfy
--   
--   <ul>
--   <li><pre><tt>lift</tt> (f k) = f' (<tt>lift</tt> . k) =&gt;
--   <tt>lift</tt> (cf f) = liftCallCC cf f'</pre></li>
--   </ul>
type CallCC (m :: * -> *) a b = ((a -> m b) -> m a) -> m a

-- | Default definition for the <a>liftCallCC</a> method.
defaultLiftCallCC :: (Monad m, LiftCallCC n) => (forall x. n m x -> t m x) -> (forall o x. t o x -> n o x) -> CallCC m (StT n a) (StT n b) -> CallCC (t m) a b

-- | Default definition for the <a>liftCallCC'</a> method.
defaultLiftCallCC' :: (Monad m, LiftCallCC n) => (forall x. n m x -> t m x) -> (forall o x. t o x -> n o x) -> CallCC m (StT n a) (StT n b) -> CallCC (t m) a b
instance Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.Except.ExceptT e)
instance Control.Monad.Trans.Lift.CallCC.LiftCallCC Control.Monad.Trans.Identity.IdentityT
instance Control.Monad.Trans.Lift.CallCC.LiftCallCC Control.Monad.Trans.List.ListT
instance Control.Monad.Trans.Lift.CallCC.LiftCallCC Control.Monad.Trans.Maybe.MaybeT
instance Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.Reader.ReaderT r)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.Writer.Lazy.WriterT w)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.Writer.Strict.WriterT w)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.Writer.CPS.Internal.WriterT w)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.RWS.Lazy.RWST r w s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.RWS.Strict.RWST r w s)
instance GHC.Base.Monoid w => Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.RWS.CPS.Internal.RWST r w s)
instance Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.State.Lazy.StateT s)
instance Control.Monad.Trans.Lift.CallCC.LiftCallCC (Control.Monad.Trans.State.Strict.StateT s)
