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


-- | Monad classes, using type families
--   
--   Monad classes using type families, with instances for various monad
--   transformers.
@package monads-tf
@version 0.3.0.1


-- | <ul>
--   <li><i>Computation type:</i> Computations which can be interrupted and
--   resumed.</li>
--   <li><i>Binding strategy:</i> Binding a function to a monadic value
--   creates a new continuation which uses the function as the continuation
--   of the monadic computation.</li>
--   <li><i>Useful for:</i> Complex control structures, error handling, and
--   creating co-routines.</li>
--   <li><i>Zero and plus:</i> None.</li>
--   <li><i>Example type:</i> <tt><tt>Cont</tt> r a</tt></li>
--   </ul>
--   
--   The Continuation monad represents computations in continuation-passing
--   style (CPS). In continuation-passing style function result is not
--   returned, but instead is passed to another function, received as a
--   parameter (continuation). Computations are built up from sequences of
--   nested continuations, terminated by a final continuation (often
--   <tt>id</tt>) which produces the final result. Since continuations are
--   functions which represent the future of a computation, manipulation of
--   the continuation functions can achieve complex manipulations of the
--   future of the computation, such as interrupting a computation in the
--   middle, aborting a portion of a computation, restarting a computation,
--   and interleaving execution of computations. The Continuation monad
--   adapts CPS to the structure of a monad.
--   
--   Before using the Continuation monad, be sure that you have a firm
--   understanding of continuation-passing style and that continuations
--   represent the best solution to your particular design problem. Many
--   algorithms which require continuations in other languages do not
--   require them in Haskell, due to Haskell's lazy semantics. Abuse of the
--   Continuation monad can produce code that is impossible to understand
--   and maintain.
module Control.Monad.Cont.Class
class Monad m => MonadCont (m :: Type -> Type)

-- | <tt>callCC</tt> (call-with-current-continuation) calls a function with
--   the current continuation as its argument. Provides an escape
--   continuation mechanism for use with Continuation monads. Escape
--   continuations allow to abort the current computation and return a
--   value immediately. They achieve a similar effect to <a>throwError</a>
--   and <a>catchError</a> within a <a>MonadError</a> monad. Advantage of
--   this function over calling <tt>return</tt> is that it makes the
--   continuation explicit, allowing more flexibility and better control
--   (see examples in <a>Control.Monad.Cont</a>).
--   
--   The standard idiom used with <tt>callCC</tt> is to provide a
--   lambda-expression to name the continuation. Then calling the named
--   continuation anywhere within its scope will escape from the
--   computation, even if it is many layers deep within nested
--   computations.
callCC :: MonadCont m => ((a -> m b) -> m a) -> m a
instance forall k (r :: k) (m :: k -> *). Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.Cont.ContT r m)
instance Control.Monad.Cont.Class.MonadCont m => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.Cont.Class.MonadCont m => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.Cont.Class.MonadCont m => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Cont.Class.MonadCont m) => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Cont.Class.MonadCont m) => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Control.Monad.Cont.Class.MonadCont m => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.Reader.ReaderT r m)
instance Control.Monad.Cont.Class.MonadCont m => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.State.Strict.StateT s m)
instance Control.Monad.Cont.Class.MonadCont m => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Cont.Class.MonadCont m) => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Cont.Class.MonadCont m) => Control.Monad.Cont.Class.MonadCont (Control.Monad.Trans.Writer.Lazy.WriterT w m)


-- | <ul>
--   <li><i>Computation type:</i> Simple function application.</li>
--   <li><i>Binding strategy:</i> The bound function is applied to the
--   input value. <tt><a>Identity</a> x &gt;&gt;= f == <a>Identity</a> (f
--   x)</tt></li>
--   <li><i>Useful for:</i> Monads can be derived from monad transformers
--   applied to the <a>Identity</a> monad.</li>
--   <li><i>Zero and plus:</i> None.</li>
--   <li><i>Example type:</i> <tt><a>Identity</a> a</tt></li>
--   </ul>
--   
--   The <tt>Identity</tt> monad is a monad that does not embody any
--   computational strategy. It simply applies the bound function to its
--   input without any modification. Computationally, there is no reason to
--   use the <tt>Identity</tt> monad instead of the much simpler act of
--   simply applying functions to their arguments. The purpose of the
--   <tt>Identity</tt> monad is its fundamental role in the theory of monad
--   transformers. Any monad transformer applied to the <tt>Identity</tt>
--   monad yields a non-transformer version of that monad.
module Control.Monad.Identity
newtype Identity a
Identity :: a -> Identity a
[runIdentity] :: Identity a -> a


-- | Classes for monad transformers.
--   
--   A monad transformer makes new monad out of an existing monad, such
--   that computations of the old monad may be embedded in the new one. To
--   construct a monad with a desired set of features, one typically starts
--   with a base monad, such as <tt>Identity</tt>, <tt>[]</tt> or
--   <a>IO</a>, and applies a sequence of monad transformers.
--   
--   Most monad transformer modules include the special case of applying
--   the transformer to <tt>Identity</tt>. For example, <tt>State s</tt> is
--   an abbreviation for <tt>StateT s Identity</tt>.
--   
--   Each monad transformer also comes with an operation
--   <tt>run</tt><i>XXX</i> to unwrap the transformer, exposing a
--   computation of the inner monad.
module Control.Monad.Trans
class forall (m :: Type -> Type). Monad m => Monad t m => MonadTrans (t :: Type -> Type -> Type -> Type)
lift :: (MonadTrans t, Monad m) => m a -> t m a
class Monad m => MonadIO (m :: Type -> Type)
liftIO :: MonadIO m => IO a -> m a


-- | MonadState class.
--   
--   This module is inspired by the paper /Functional Programming with
--   Overloading and Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.State.Class

-- | <i>get</i> returns the state from the internals of the monad.
--   
--   <i>put</i> replaces the state inside the monad.
class Monad m => MonadState (m :: Type -> Type) where {
    type StateType (m :: Type -> Type);
}
get :: MonadState m => m (StateType m)
put :: MonadState m => StateType m -> m ()

-- | Monadic state transformer.
--   
--   Maps an old state to a new state inside a state monad. The old state
--   is thrown away.
--   
--   <pre>
--   Main&gt; :t modify ((+1) :: Int -&gt; Int)
--   modify (...) :: (MonadState Int a) =&gt; a ()
--   </pre>
--   
--   This says that <tt>modify (+1)</tt> acts over any Monad that is a
--   member of the <tt>MonadState</tt> class, with an <tt>Int</tt> state.
modify :: MonadState m => (StateType m -> StateType m) -> m ()

-- | Gets specific component of the state, using a projection function
--   supplied.
gets :: MonadState m => (StateType m -> a) -> m a
instance Control.Monad.State.Class.MonadState m => Control.Monad.State.Class.MonadState (Control.Monad.Trans.Cont.ContT r m)
instance Control.Monad.State.Class.MonadState m => Control.Monad.State.Class.MonadState (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.State.Class.MonadState m => Control.Monad.State.Class.MonadState (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.State.Class.MonadState m => Control.Monad.State.Class.MonadState (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid w) => Control.Monad.State.Class.MonadState (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid w) => Control.Monad.State.Class.MonadState (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Control.Monad.State.Class.MonadState m => Control.Monad.State.Class.MonadState (Control.Monad.Trans.Reader.ReaderT r m)
instance GHC.Internal.Base.Monad m => Control.Monad.State.Class.MonadState (Control.Monad.Trans.State.Strict.StateT s m)
instance GHC.Internal.Base.Monad m => Control.Monad.State.Class.MonadState (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.State.Class.MonadState m) => Control.Monad.State.Class.MonadState (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.State.Class.MonadState m) => Control.Monad.State.Class.MonadState (Control.Monad.Trans.Writer.Lazy.WriterT w m)


-- | Strict state monads.
--   
--   This module is inspired by the paper /Functional Programming with
--   Overloading and Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.State.Strict

-- | <i>get</i> returns the state from the internals of the monad.
--   
--   <i>put</i> replaces the state inside the monad.
class Monad m => MonadState (m :: Type -> Type) where {
    type StateType (m :: Type -> Type);
}
get :: MonadState m => m (StateType m)
put :: MonadState m => StateType m -> m ()

-- | Monadic state transformer.
--   
--   Maps an old state to a new state inside a state monad. The old state
--   is thrown away.
--   
--   <pre>
--   Main&gt; :t modify ((+1) :: Int -&gt; Int)
--   modify (...) :: (MonadState Int a) =&gt; a ()
--   </pre>
--   
--   This says that <tt>modify (+1)</tt> acts over any Monad that is a
--   member of the <tt>MonadState</tt> class, with an <tt>Int</tt> state.
modify :: MonadState m => (StateType m -> StateType m) -> m ()

-- | Gets specific component of the state, using a projection function
--   supplied.
gets :: MonadState m => (StateType m -> a) -> m a
type State s = StateT s Identity
runState :: State s a -> s -> (a, s)
evalState :: State s a -> s -> a
execState :: State s a -> s -> s
mapState :: ((a, s) -> (b, s)) -> State s a -> State s b
withState :: (s -> s) -> State s a -> State s a
newtype StateT s (m :: Type -> Type) a
StateT :: (s -> m (a, s)) -> StateT s (m :: Type -> Type) a
[runStateT] :: StateT s (m :: Type -> Type) a -> s -> m (a, s)
evalStateT :: Monad m => StateT s m a -> s -> m a
execStateT :: Monad m => StateT s m a -> s -> m s
mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
withStateT :: forall s (m :: Type -> Type) a. (s -> s) -> StateT s m a -> StateT s m a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a


-- | Lazy state monads.
--   
--   This module is inspired by the paper /Functional Programming with
--   Overloading and Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.State.Lazy

-- | <i>get</i> returns the state from the internals of the monad.
--   
--   <i>put</i> replaces the state inside the monad.
class Monad m => MonadState (m :: Type -> Type) where {
    type StateType (m :: Type -> Type);
}
get :: MonadState m => m (StateType m)
put :: MonadState m => StateType m -> m ()

-- | Monadic state transformer.
--   
--   Maps an old state to a new state inside a state monad. The old state
--   is thrown away.
--   
--   <pre>
--   Main&gt; :t modify ((+1) :: Int -&gt; Int)
--   modify (...) :: (MonadState Int a) =&gt; a ()
--   </pre>
--   
--   This says that <tt>modify (+1)</tt> acts over any Monad that is a
--   member of the <tt>MonadState</tt> class, with an <tt>Int</tt> state.
modify :: MonadState m => (StateType m -> StateType m) -> m ()

-- | Gets specific component of the state, using a projection function
--   supplied.
gets :: MonadState m => (StateType m -> a) -> m a
type State s = StateT s Identity
runState :: State s a -> s -> (a, s)
evalState :: State s a -> s -> a
execState :: State s a -> s -> s
mapState :: ((a, s) -> (b, s)) -> State s a -> State s b
withState :: (s -> s) -> State s a -> State s a
newtype StateT s (m :: Type -> Type) a
StateT :: (s -> m (a, s)) -> StateT s (m :: Type -> Type) a
[runStateT] :: StateT s (m :: Type -> Type) a -> s -> m (a, s)
evalStateT :: Monad m => StateT s m a -> s -> m a
execStateT :: Monad m => StateT s m a -> s -> m s
mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
withStateT :: forall s (m :: Type -> Type) a. (s -> s) -> StateT s m a -> StateT s m a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a


-- | State monads.
--   
--   This module is inspired by the paper /Functional Programming with
--   Overloading and Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.State


-- | <ul>
--   <li><i>Computation type:</i> Computations which read values from a
--   shared environment.</li>
--   <li><i>Binding strategy:</i> Monad values are functions from the
--   environment to a value. The bound function is applied to the bound
--   value, and both have access to the shared environment.</li>
--   <li><i>Useful for:</i> Maintaining variable bindings, or other shared
--   environment.</li>
--   <li><i>Zero and plus:</i> None.</li>
--   <li><i>Example type:</i> <tt><tt>Reader</tt> [(String,Value)]
--   a</tt></li>
--   </ul>
--   
--   The <tt>Reader</tt> monad (also called the Environment monad).
--   Represents a computation, which can read values from a shared
--   environment, pass values from function to function, and execute
--   sub-computations in a modified environment. Using <tt>Reader</tt>
--   monad for such computations is often clearer and easier than using the
--   <a>State</a> monad.
--   
--   Inspired by the paper <i>Functional Programming with Overloading and
--   Higher-Order Polymorphism</i>, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.Reader.Class

-- | See examples in <a>Control.Monad.Reader</a>. Note, the partially
--   applied function type <tt>(-&gt;) r</tt> is a simple reader monad. See
--   the <tt>instance</tt> declaration below.
class Monad m => MonadReader (m :: Type -> Type) where {
    type EnvType (m :: Type -> Type);
}

-- | Retrieves the monad environment.
ask :: MonadReader m => m (EnvType m)

-- | Executes a computation in a modified environment.
local :: MonadReader m => (EnvType m -> EnvType m) -> m a -> m a

-- | Retrieves a function of the current environment.
asks :: MonadReader m => (EnvType m -> a) -> m a
instance Control.Monad.Reader.Class.MonadReader m => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.Cont.ContT r m)
instance Control.Monad.Reader.Class.MonadReader m => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.Reader.Class.MonadReader ((->) r)
instance Control.Monad.Reader.Class.MonadReader m => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.Reader.Class.MonadReader m => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance GHC.Internal.Base.Monad m => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.Reader.ReaderT r m)
instance Control.Monad.Reader.Class.MonadReader m => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.State.Strict.StateT s m)
instance Control.Monad.Reader.Class.MonadReader m => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Reader.Class.MonadReader m) => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Reader.Class.MonadReader m) => Control.Monad.Reader.Class.MonadReader (Control.Monad.Trans.Writer.Lazy.WriterT w m)


-- | <ul>
--   <li><i>Computation type:</i> Computations which read values from a
--   shared environment.</li>
--   <li><i>Binding strategy:</i> Monad values are functions from the
--   environment to a value. The bound function is applied to the bound
--   value, and both have access to the shared environment.</li>
--   <li><i>Useful for:</i> Maintaining variable bindings, or other shared
--   environment.</li>
--   <li><i>Zero and plus:</i> None.</li>
--   <li><i>Example type:</i> <tt><a>Reader</a> [(String,Value)]
--   a</tt></li>
--   </ul>
--   
--   The <a>Reader</a> monad (also called the Environment monad).
--   Represents a computation, which can read values from a shared
--   environment, pass values from function to function, and execute
--   sub-computations in a modified environment. Using <a>Reader</a> monad
--   for such computations is often clearer and easier than using the
--   <a>State</a> monad.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.Reader

-- | See examples in <a>Control.Monad.Reader</a>. Note, the partially
--   applied function type <tt>(-&gt;) r</tt> is a simple reader monad. See
--   the <tt>instance</tt> declaration below.
class Monad m => MonadReader (m :: Type -> Type) where {
    type EnvType (m :: Type -> Type);
}

-- | Retrieves the monad environment.
ask :: MonadReader m => m (EnvType m)

-- | Executes a computation in a modified environment.
local :: MonadReader m => (EnvType m -> EnvType m) -> m a -> m a

-- | Retrieves a function of the current environment.
asks :: MonadReader m => (EnvType m -> a) -> m a
type Reader r = ReaderT r Identity
runReader :: Reader r a -> r -> a
mapReader :: (a -> b) -> Reader r a -> Reader r b
withReader :: (r' -> r) -> Reader r a -> Reader r' a
newtype ReaderT r (m :: Type -> Type) a
ReaderT :: (r -> m a) -> ReaderT r (m :: Type -> Type) a
[runReaderT] :: ReaderT r (m :: Type -> Type) a -> r -> m a
mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b
withReaderT :: forall r' r (m :: Type -> Type) a. (r' -> r) -> ReaderT r m a -> ReaderT r' m a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a


-- | <ul>
--   <li><i>Computation type:</i> Computations which may fail or throw
--   exceptions.</li>
--   <li><i>Binding strategy:</i> Failure records information about the
--   cause/location of the failure. Failure values bypass the bound
--   function, other values are used as inputs to the bound function.</li>
--   <li><i>Useful for:</i> Building computations from sequences of
--   functions that may fail or using exception handling to structure error
--   handling.</li>
--   <li><i>Zero and plus:</i> Zero is represented by an empty error and
--   the plus operation executes its second argument if the first
--   fails.</li>
--   <li><i>Example type:</i> <tt><a>Either</a> <a>String</a> a</tt></li>
--   </ul>
--   
--   The Error monad (also called the Exception monad).
module Control.Monad.Except.Class

-- | The strategy of combining computations that can throw exceptions by
--   bypassing bound functions from the point an exception is thrown to the
--   point that it is handled.
--   
--   Is parameterized over the type of error information and the monad type
--   constructor. It is common to use <tt><a>Either</a> String</tt> as the
--   monad type constructor for an error monad in which error descriptions
--   take the form of strings. In that case and many other common cases the
--   resulting monad is already defined as an instance of the
--   <a>MonadError</a> class. You can also define your own a monad type
--   constructor other than <tt><a>Either</a> e</tt>, in which case you
--   will have to explicitly define an instance of the <a>MonadError</a>
--   class.
class Monad m => MonadError (m :: Type -> Type) where {
    type ErrorType (m :: Type -> Type);
}

-- | Is used within a monadic computation to begin exception processing.
throwError :: MonadError m => ErrorType m -> m a

-- | A handler function to handle previous errors and return to normal
--   execution. A common idiom is:
--   
--   <pre>
--   do { action1; action2; action3 } `catchError` handler
--   </pre>
--   
--   where the <tt>action</tt> functions can call <a>throwError</a>. Note
--   that <tt>handler</tt> and the do-block must have the same return type.
catchError :: MonadError m => m a -> (ErrorType m -> m a) -> m a
instance Control.Monad.Except.Class.MonadError (GHC.Internal.Data.Either.Either e)
instance GHC.Internal.Base.Monad m => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.Except.Class.MonadError GHC.Types.IO
instance Control.Monad.Except.Class.MonadError m => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.Except.Class.MonadError m => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Except.Class.MonadError m) => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Except.Class.MonadError m) => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Control.Monad.Except.Class.MonadError m => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.Reader.ReaderT r m)
instance Control.Monad.Except.Class.MonadError m => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.State.Strict.StateT s m)
instance Control.Monad.Except.Class.MonadError m => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Except.Class.MonadError m) => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Except.Class.MonadError m) => Control.Monad.Except.Class.MonadError (Control.Monad.Trans.Writer.Lazy.WriterT w m)


-- | <ul>
--   <li><i>Computation type:</i> Computations which may fail or throw
--   exceptions.</li>
--   <li><i>Binding strategy:</i> Failure records information about the
--   cause/location of the failure. Failure values bypass the bound
--   function, other values are used as inputs to the bound function.</li>
--   <li><i>Useful for:</i> Building computations from sequences of
--   functions that may fail or using exception handling to structure error
--   handling.</li>
--   <li><i>Zero and plus:</i> Zero is represented by an empty error and
--   the plus operation executes its second argument if the first
--   fails.</li>
--   <li><i>Example type:</i> <tt><a>Either</a> String a</tt></li>
--   </ul>
--   
--   The Error monad (also called the Exception monad).
module Control.Monad.Except

-- | The strategy of combining computations that can throw exceptions by
--   bypassing bound functions from the point an exception is thrown to the
--   point that it is handled.
--   
--   Is parameterized over the type of error information and the monad type
--   constructor. It is common to use <tt><a>Either</a> String</tt> as the
--   monad type constructor for an error monad in which error descriptions
--   take the form of strings. In that case and many other common cases the
--   resulting monad is already defined as an instance of the
--   <a>MonadError</a> class. You can also define your own a monad type
--   constructor other than <tt><a>Either</a> e</tt>, in which case you
--   will have to explicitly define an instance of the <a>MonadError</a>
--   class.
class Monad m => MonadError (m :: Type -> Type) where {
    type ErrorType (m :: Type -> Type);
}

-- | Is used within a monadic computation to begin exception processing.
throwError :: MonadError m => ErrorType m -> m a

-- | A handler function to handle previous errors and return to normal
--   execution. A common idiom is:
--   
--   <pre>
--   do { action1; action2; action3 } `catchError` handler
--   </pre>
--   
--   where the <tt>action</tt> functions can call <a>throwError</a>. Note
--   that <tt>handler</tt> and the do-block must have the same return type.
catchError :: MonadError m => m a -> (ErrorType m -> m a) -> m a

-- | <a>MonadError</a> analogue to the <a>try</a> function.
tryError :: MonadError m => m a -> m (Either (ErrorType m) a)

-- | <a>MonadError</a> analogue to the <a>withExceptT</a> function. Modify
--   the value (but not the type) of an error. The type is fixed because of
--   the <a>ErrorType</a> type family.
withError :: MonadError m => (ErrorType m -> ErrorType m) -> m a -> m a
newtype ExceptT e (m :: Type -> Type) a
ExceptT :: m (Either e a) -> ExceptT e (m :: Type -> Type) a
runExceptT :: ExceptT e m a -> m (Either e a)
mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b
withExceptT :: forall (m :: Type -> Type) e e' a. Functor m => (e -> e') -> ExceptT e m a -> ExceptT e' m a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a


-- | <ul>
--   <li><i>Computation type:</i> Computations which can be interrupted and
--   resumed.</li>
--   <li><i>Binding strategy:</i> Binding a function to a monadic value
--   creates a new continuation which uses the function as the continuation
--   of the monadic computation.</li>
--   <li><i>Useful for:</i> Complex control structures, error handling, and
--   creating co-routines.</li>
--   <li><i>Zero and plus:</i> None.</li>
--   <li><i>Example type:</i> <tt><a>Cont</a> r a</tt></li>
--   </ul>
--   
--   The Continuation monad represents computations in continuation-passing
--   style (CPS). In continuation-passing style function result is not
--   returned, but instead is passed to another function, received as a
--   parameter (continuation). Computations are built up from sequences of
--   nested continuations, terminated by a final continuation (often
--   <tt>id</tt>) which produces the final result. Since continuations are
--   functions which represent the future of a computation, manipulation of
--   the continuation functions can achieve complex manipulations of the
--   future of the computation, such as interrupting a computation in the
--   middle, aborting a portion of a computation, restarting a computation,
--   and interleaving execution of computations. The Continuation monad
--   adapts CPS to the structure of a monad.
--   
--   Before using the Continuation monad, be sure that you have a firm
--   understanding of continuation-passing style and that continuations
--   represent the best solution to your particular design problem. Many
--   algorithms which require continuations in other languages do not
--   require them in Haskell, due to Haskell's lazy semantics. Abuse of the
--   Continuation monad can produce code that is impossible to understand
--   and maintain.
module Control.Monad.Cont
class Monad m => MonadCont (m :: Type -> Type)

-- | <tt>callCC</tt> (call-with-current-continuation) calls a function with
--   the current continuation as its argument. Provides an escape
--   continuation mechanism for use with Continuation monads. Escape
--   continuations allow to abort the current computation and return a
--   value immediately. They achieve a similar effect to <a>throwError</a>
--   and <a>catchError</a> within a <a>MonadError</a> monad. Advantage of
--   this function over calling <tt>return</tt> is that it makes the
--   continuation explicit, allowing more flexibility and better control
--   (see examples in <a>Control.Monad.Cont</a>).
--   
--   The standard idiom used with <tt>callCC</tt> is to provide a
--   lambda-expression to name the continuation. Then calling the named
--   continuation anywhere within its scope will escape from the
--   computation, even if it is many layers deep within nested
--   computations.
callCC :: MonadCont m => ((a -> m b) -> m a) -> m a
type Cont r = ContT r Identity
runCont :: Cont r a -> (a -> r) -> r
mapCont :: (r -> r) -> Cont r a -> Cont r a
withCont :: ((b -> r) -> a -> r) -> Cont r a -> Cont r b
newtype ContT (r :: k) (m :: k -> Type) a
ContT :: ((a -> m r) -> m r) -> ContT (r :: k) (m :: k -> Type) a
[runContT] :: ContT (r :: k) (m :: k -> Type) a -> (a -> m r) -> m r
mapContT :: forall {k} m (r :: k) a. (m r -> m r) -> ContT r m a -> ContT r m a
withContT :: forall {k} b m (r :: k) a. ((b -> m r) -> a -> m r) -> ContT r m a -> ContT r m b
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()


-- | The MonadWriter class.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/pubs/springschool.html</a>) Advanced
--   School of Functional Programming, 1995.
module Control.Monad.Writer.Class
class (Monoid WriterType m, Monad m) => MonadWriter (m :: Type -> Type) where {
    type WriterType (m :: Type -> Type);
}

-- | Shout to the monad what you want to be heard. The monad carries this
--   packet upwards, merging it if needed (hence the <a>Monoid</a>
--   requirement).
tell :: MonadWriter m => WriterType m -> m ()

-- | Listen to a monad acting, and return what the monad "said".
listen :: MonadWriter m => m a -> m (a, WriterType m)

-- | Provide a writer transformer which changes internals of the written
--   object.
pass :: MonadWriter m => m (a, WriterType m -> WriterType m) -> m a

-- | <tt><a>listens</a> f m</tt> is an action that executes the action
--   <tt>m</tt> and adds the result of applying <tt>f</tt> to the output to
--   the value of the computation.
--   
--   <ul>
--   <li><pre><a>listens</a> f m = <tt>liftM</tt> (id *** f) (<a>listen</a>
--   m)</pre></li>
--   </ul>
listens :: MonadWriter m => (WriterType m -> b) -> m a -> m (a, b)

-- | <tt><a>censor</a> f m</tt> is an action that executes the action
--   <tt>m</tt> and applies the function <tt>f</tt> to its output, leaving
--   the return value unchanged.
--   
--   <ul>
--   <li><pre><a>censor</a> f m = <a>pass</a> (<tt>liftM</tt> (\ x -&gt;
--   (x,f)) m)</pre></li>
--   </ul>
censor :: MonadWriter m => (WriterType m -> WriterType m) -> m a -> m a
instance Control.Monad.Writer.Class.MonadWriter m => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.Writer.Class.MonadWriter m => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.Writer.Class.MonadWriter m => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Control.Monad.Writer.Class.MonadWriter m => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.Reader.ReaderT r m)
instance Control.Monad.Writer.Class.MonadWriter m => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.State.Strict.StateT s m)
instance Control.Monad.Writer.Class.MonadWriter m => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.Writer.Class.MonadWriter (Control.Monad.Trans.Writer.Lazy.WriterT w m)


-- | Declaration of the MonadRWS class.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.RWS.Class
class (Monoid WriterType m, MonadReader m, MonadWriter m, MonadState m) => MonadRWS (m :: Type -> Type)
instance Control.Monad.RWS.Class.MonadRWS m => Control.Monad.RWS.Class.MonadRWS (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.RWS.Class.MonadRWS m => Control.Monad.RWS.Class.MonadRWS (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.RWS.Class.MonadRWS m => Control.Monad.RWS.Class.MonadRWS (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.RWS.Class.MonadRWS (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.Monoid w, GHC.Internal.Base.Monad m) => Control.Monad.RWS.Class.MonadRWS (Control.Monad.Trans.RWS.Lazy.RWST r w s m)


-- | Strict RWS monad.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.RWS.Strict
type RWS r w s = RWST r w s Identity
runRWS :: RWS r w s a -> r -> s -> (a, s, w)
evalRWS :: RWS r w s a -> r -> s -> (a, w)
execRWS :: RWS r w s a -> r -> s -> (s, w)
mapRWS :: ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s b
withRWS :: (r' -> s -> (r, s)) -> RWS r w s a -> RWS r' w s a
newtype RWST r w s (m :: Type -> Type) a
RWST :: (r -> s -> m (a, s, w)) -> RWST r w s (m :: Type -> Type) a
[runRWST] :: RWST r w s (m :: Type -> Type) a -> r -> s -> m (a, s, w)
evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)
execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)
mapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n b
withRWST :: forall r' s r w (m :: Type -> Type) a. (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a
class Semigroup a => Monoid a
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
(<>) :: Semigroup a => a -> a -> a
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool
newtype Product a
Product :: a -> Product a
[getProduct] :: Product a -> a
newtype Dual a
Dual :: a -> Dual a
[getDual] :: Dual a -> a
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a
newtype Sum a
Sum :: a -> Sum a
[getSum] :: Sum a -> a
newtype Last a
Last :: Maybe a -> Last a
[getLast] :: Last a -> Maybe a
newtype First a
First :: Maybe a -> First a
[getFirst] :: First a -> Maybe a
newtype All
All :: Bool -> All
[getAll] :: All -> Bool
newtype Ap (f :: k -> Type) (a :: k)
Ap :: f a -> Ap (f :: k -> Type) (a :: k)
[getAp] :: Ap (f :: k -> Type) (a :: k) -> f a
newtype Alt (f :: k -> Type) (a :: k)
Alt :: f a -> Alt (f :: k -> Type) (a :: k)
[getAlt] :: Alt (f :: k -> Type) (a :: k) -> f a


-- | Lazy RWS monad.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.RWS.Lazy
type RWS r w s = RWST r w s Identity
runRWS :: RWS r w s a -> r -> s -> (a, s, w)
evalRWS :: RWS r w s a -> r -> s -> (a, w)
execRWS :: RWS r w s a -> r -> s -> (s, w)
mapRWS :: ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s b
withRWS :: (r' -> s -> (r, s)) -> RWS r w s a -> RWS r' w s a
newtype RWST r w s (m :: Type -> Type) a
RWST :: (r -> s -> m (a, s, w)) -> RWST r w s (m :: Type -> Type) a
[runRWST] :: RWST r w s (m :: Type -> Type) a -> r -> s -> m (a, s, w)
evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)
execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)
mapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n b
withRWST :: forall r' s r w (m :: Type -> Type) a. (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a
class Semigroup a => Monoid a
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
(<>) :: Semigroup a => a -> a -> a
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool
newtype Product a
Product :: a -> Product a
[getProduct] :: Product a -> a
newtype Dual a
Dual :: a -> Dual a
[getDual] :: Dual a -> a
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a
newtype Sum a
Sum :: a -> Sum a
[getSum] :: Sum a -> a
newtype Last a
Last :: Maybe a -> Last a
[getLast] :: Last a -> Maybe a
newtype First a
First :: Maybe a -> First a
[getFirst] :: First a -> Maybe a
newtype All
All :: Bool -> All
[getAll] :: All -> Bool
newtype Ap (f :: k -> Type) (a :: k)
Ap :: f a -> Ap (f :: k -> Type) (a :: k)
[getAp] :: Ap (f :: k -> Type) (a :: k) -> f a
newtype Alt (f :: k -> Type) (a :: k)
Alt :: f a -> Alt (f :: k -> Type) (a :: k)
[getAlt] :: Alt (f :: k -> Type) (a :: k) -> f a


-- | Declaration of the MonadRWS class.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/</a>) Advanced School of Functional
--   Programming, 1995.
module Control.Monad.RWS


-- | Lazy writer monads.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/pubs/springschool.html</a>) Advanced
--   School of Functional Programming, 1995.
module Control.Monad.Writer.Lazy
class (Monoid WriterType m, Monad m) => MonadWriter (m :: Type -> Type) where {
    type WriterType (m :: Type -> Type);
}

-- | Shout to the monad what you want to be heard. The monad carries this
--   packet upwards, merging it if needed (hence the <a>Monoid</a>
--   requirement).
tell :: MonadWriter m => WriterType m -> m ()

-- | Listen to a monad acting, and return what the monad "said".
listen :: MonadWriter m => m a -> m (a, WriterType m)

-- | Provide a writer transformer which changes internals of the written
--   object.
pass :: MonadWriter m => m (a, WriterType m -> WriterType m) -> m a

-- | <tt><a>listens</a> f m</tt> is an action that executes the action
--   <tt>m</tt> and adds the result of applying <tt>f</tt> to the output to
--   the value of the computation.
--   
--   <ul>
--   <li><pre><a>listens</a> f m = <tt>liftM</tt> (id *** f) (<a>listen</a>
--   m)</pre></li>
--   </ul>
listens :: MonadWriter m => (WriterType m -> b) -> m a -> m (a, b)

-- | <tt><a>censor</a> f m</tt> is an action that executes the action
--   <tt>m</tt> and applies the function <tt>f</tt> to its output, leaving
--   the return value unchanged.
--   
--   <ul>
--   <li><pre><a>censor</a> f m = <a>pass</a> (<tt>liftM</tt> (\ x -&gt;
--   (x,f)) m)</pre></li>
--   </ul>
censor :: MonadWriter m => (WriterType m -> WriterType m) -> m a -> m a
type Writer w = WriterT w Identity
runWriter :: Writer w a -> (a, w)
execWriter :: Writer w a -> w
mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b
newtype WriterT w (m :: Type -> Type) a
WriterT :: m (a, w) -> WriterT w (m :: Type -> Type) a
[runWriterT] :: WriterT w (m :: Type -> Type) a -> m (a, w)
execWriterT :: Monad m => WriterT w m a -> m w
mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a
class Semigroup a => Monoid a
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
(<>) :: Semigroup a => a -> a -> a
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool
newtype Product a
Product :: a -> Product a
[getProduct] :: Product a -> a
newtype Dual a
Dual :: a -> Dual a
[getDual] :: Dual a -> a
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a
newtype Sum a
Sum :: a -> Sum a
[getSum] :: Sum a -> a
newtype Last a
Last :: Maybe a -> Last a
[getLast] :: Last a -> Maybe a
newtype First a
First :: Maybe a -> First a
[getFirst] :: First a -> Maybe a
newtype All
All :: Bool -> All
[getAll] :: All -> Bool
newtype Ap (f :: k -> Type) (a :: k)
Ap :: f a -> Ap (f :: k -> Type) (a :: k)
[getAp] :: Ap (f :: k -> Type) (a :: k) -> f a
newtype Alt (f :: k -> Type) (a :: k)
Alt :: f a -> Alt (f :: k -> Type) (a :: k)
[getAlt] :: Alt (f :: k -> Type) (a :: k) -> f a


-- | The MonadWriter class.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/pubs/springschool.html</a>) Advanced
--   School of Functional Programming, 1995.
module Control.Monad.Writer


-- | Strict writer monads.
--   
--   Inspired by the paper /Functional Programming with Overloading and
--   Higher-Order Polymorphism/, Mark P Jones
--   (<a>http://web.cecs.pdx.edu/~mpj/pubs/springschool.html</a>) Advanced
--   School of Functional Programming, 1995.
module Control.Monad.Writer.Strict
class (Monoid WriterType m, Monad m) => MonadWriter (m :: Type -> Type) where {
    type WriterType (m :: Type -> Type);
}

-- | Shout to the monad what you want to be heard. The monad carries this
--   packet upwards, merging it if needed (hence the <a>Monoid</a>
--   requirement).
tell :: MonadWriter m => WriterType m -> m ()

-- | Listen to a monad acting, and return what the monad "said".
listen :: MonadWriter m => m a -> m (a, WriterType m)

-- | Provide a writer transformer which changes internals of the written
--   object.
pass :: MonadWriter m => m (a, WriterType m -> WriterType m) -> m a

-- | <tt><a>listens</a> f m</tt> is an action that executes the action
--   <tt>m</tt> and adds the result of applying <tt>f</tt> to the output to
--   the value of the computation.
--   
--   <ul>
--   <li><pre><a>listens</a> f m = <tt>liftM</tt> (id *** f) (<a>listen</a>
--   m)</pre></li>
--   </ul>
listens :: MonadWriter m => (WriterType m -> b) -> m a -> m (a, b)

-- | <tt><a>censor</a> f m</tt> is an action that executes the action
--   <tt>m</tt> and applies the function <tt>f</tt> to its output, leaving
--   the return value unchanged.
--   
--   <ul>
--   <li><pre><a>censor</a> f m = <a>pass</a> (<tt>liftM</tt> (\ x -&gt;
--   (x,f)) m)</pre></li>
--   </ul>
censor :: MonadWriter m => (WriterType m -> WriterType m) -> m a -> m a
type Writer w = WriterT w Identity
runWriter :: Writer w a -> (a, w)
execWriter :: Writer w a -> w
mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b
newtype WriterT w (m :: Type -> Type) a
WriterT :: m (a, w) -> WriterT w (m :: Type -> Type) a
[runWriterT] :: WriterT w (m :: Type -> Type) a -> m (a, w)
execWriterT :: Monad m => WriterT w m a -> m w
mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
join :: Monad m => m (m a) -> m a
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
ap :: Monad m => m (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
when :: Applicative f => Bool -> f () -> f ()
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM :: Applicative m => Int -> m a -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
void :: Functor f => f a -> f ()
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
guard :: Alternative f => Bool -> f ()
class Monad m => MonadFix (m :: Type -> Type)
mfix :: MonadFix m => (a -> m a) -> m a
fix :: (a -> a) -> a
class Semigroup a => Monoid a
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
(<>) :: Semigroup a => a -> a -> a
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool
newtype Product a
Product :: a -> Product a
[getProduct] :: Product a -> a
newtype Dual a
Dual :: a -> Dual a
[getDual] :: Dual a -> a
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a
newtype Sum a
Sum :: a -> Sum a
[getSum] :: Sum a -> a
newtype Last a
Last :: Maybe a -> Last a
[getLast] :: Last a -> Maybe a
newtype First a
First :: Maybe a -> First a
[getFirst] :: First a -> Maybe a
newtype All
All :: Bool -> All
[getAll] :: All -> Bool
newtype Ap (f :: k -> Type) (a :: k)
Ap :: f a -> Ap (f :: k -> Type) (a :: k)
[getAp] :: Ap (f :: k -> Type) (a :: k) -> f a
newtype Alt (f :: k -> Type) (a :: k)
Alt :: f a -> Alt (f :: k -> Type) (a :: k)
[getAlt] :: Alt (f :: k -> Type) (a :: k) -> f a
