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

-- | A collection of monad transformers.
--   
--   A collection of monad transformers.
@package monadLib
@version 3.10.1

-- | This library provides a collection of monad transformers that can be
--   combined to produce various monads.
module MonadLib

-- | Computations with no effects.
data Id a

-- | Computation with no effects (strict).
data Lift a

-- | Adds no new features. Useful as a placeholder.
data IdT (m :: Type -> Type) a

-- | Add support for propagating a context of type i.
data ReaderT i (m :: Type -> Type) a

-- | Add support for collecting values of type i. The type
--   i should be a monoid, whose unit is used to represent a lack
--   of a value, and whose binary operation is used to combine multiple
--   values. This transformer is strict in its output component.
data WriterT i (m :: Type -> Type) a

-- | Add support for threading state of type i.
data StateT i (m :: Type -> Type) a

-- | Add support for exceptions of type i.
data ExceptionT i (m :: Type -> Type) a

-- | Add support for multiple answers.
data ChoiceT (m :: Type -> Type) a

-- | Add support for continuations within a prompt of type i.
data ContT i (m :: Type -> Type) a
class MonadT (t :: Type -> Type -> Type -> Type)

-- | Promote a computation from the underlying monad.
lift :: (MonadT t, Monad m) => m a -> t m a
class (Monad m, Monad n) => BaseM (m :: Type -> Type) (n :: Type -> Type) | m -> n

-- | Promote a computation from the base monad.
inBase :: BaseM m n => n a -> m a

-- | Classifies monads that provide access to a context of type i.
class Monad m => ReaderM (m :: Type -> Type) i | m -> i

-- | Get the context.
ask :: ReaderM m i => m i

-- | Classifies monads that can collect values of type i.
class Monad m => WriterM (m :: Type -> Type) i | m -> i

-- | Add a value to the collection.
put :: WriterM m i => i -> m ()

-- | Classifies monads that propagate a state component of type i.
class Monad m => StateM (m :: Type -> Type) i | m -> i

-- | Get the state.
get :: StateM m i => m i

-- | Set the state.
set :: StateM m i => i -> m ()

-- | Classifies monads that support raising exceptions of type i.
class Monad m => ExceptionM (m :: Type -> Type) i | m -> i

-- | Raise an exception.
raise :: ExceptionM m i => i -> m a

-- | Classifies monads that provide access to a computation's continuation.
class Monad m => ContM (m :: Type -> Type)

-- | Capture the current continuation.
callWithCC :: ContM m => ((a -> Label m) -> m a) -> m a

-- | Classifies monads that support aborting the program and returning a
--   given final result of type i.
class Monad m => AbortM (m :: Type -> Type) i

-- | Abort the program with the given value as final result.
abort :: AbortM m i => i -> m a

-- | An explicit representation for monadic continuations.
data Label (m :: Type -> Type)

-- | Capture the current continuation. This function is like return,
--   except that it also captures the current continuation. Later, we can
--   use jump to repeat the computation from this point onwards but
--   with a possibly different value.
labelCC :: ContM m => a -> m (a, a -> Label m)

-- | Capture the current continuation. Later we can use jump to
--   restart the program from this point.
labelCC_ :: ContM m => m (Label m)

-- | Restart a previously captured computation.
jump :: Label m -> m a

-- | Label a given continuation.
labelC :: (forall b. () => m b) -> Label m

-- | A version of callWithCC that avoids the need for an explicit
--   use of the jump function.
callCC :: ContM m => ((a -> m b) -> m a) -> m a

-- | Get the result of a pure computation.
runId :: Id a -> a

-- | Get the result of a pure strict computation.
runLift :: Lift a -> a

-- | Remove an identity layer.
runIdT :: IdT m a -> m a

-- | Execute a reader computation in the given context.
runReaderT :: i -> ReaderT i m a -> m a

-- | Execute a writer computation. Returns the result and the collected
--   output.
runWriterT :: Monad m => WriterT i m a -> m (a, i)

-- | Execute a stateful computation in the given initial state. The second
--   component of the result is the final state.
runStateT :: i -> StateT i m a -> m (a, i)

-- | Execute a computation with exceptions. Successful results are tagged
--   with Right, exceptional results are tagged with Left.
runExceptionT :: ExceptionT i m a -> m (Either i a)

-- | Execute a computation with the given continuation.
runContT :: (a -> m i) -> ContT i m a -> m i

-- | Execute a computation that may return multiple answers. The resulting
--   computation returns Nothing if no answers were found, or
--   Just (answer,new_comp), where answer is an answer,
--   and new_comp is a computation that may produce more answers.
--   The search is depth-first and left-biased with respect to the
--   mplus operation.
runChoiceT :: Monad m => ChoiceT m a -> m (Maybe (a, ChoiceT m a))

-- | Execute a computation that may return multiple answers, returning at
--   most one answer.
findOne :: Monad m => ChoiceT m a -> m (Maybe a)

-- | Execute a computation that may return multiple answers, collecting all
--   possible answers.
findAll :: Monad m => ChoiceT m a -> m [a]

-- | Generalized running.
class Monad m => RunM (m :: Type -> Type) a r | m a -> r
runM :: RunM m a r => m a -> r

-- | Classifies monads that support changing the context for a
--   sub-computation.
class ReaderM m i => RunReaderM (m :: Type -> Type) i | m -> i

-- | Change the context for the duration of a sub-computation.
local :: RunReaderM m i => i -> m a -> m a

-- | Classifies monads that support collecting the output of a
--   sub-computation.
class WriterM m i => RunWriterM (m :: Type -> Type) i | m -> i

-- | Collect the output from a sub-computation.
collect :: RunWriterM m i => m a -> m (a, i)

-- | Classifies monads that support handling of exceptions.
class ExceptionM m i => RunExceptionM (m :: Type -> Type) i | m -> i

-- | Convert computations that may raise an exception into computations
--   that do not raise exception but instead, yield a tagged results.
--   Exceptions are tagged with Left, successful computations are
--   tagged with Right.
try :: RunExceptionM m i => m a -> m (Either i a)

-- | Apply a function to the environment. Useful for accessing environmnt
--   components.
asks :: ReaderM m r => (r -> a) -> m a

-- | Add content the output and return a result.
puts :: WriterM m w => (a, w) -> m a

-- | Update the state and return a result.
sets :: StateM m s => (s -> (a, s)) -> m a

-- | Updates the state with the given function.
sets_ :: StateM m s => (s -> s) -> m ()

-- | Either raise an exception or return a value. Left values
--   signify the we should raise an exception, Right values indicate
--   success.
raises :: ExceptionM m x => Either x a -> m a

-- | Modify the environment for the duration of a computation.
mapReader :: RunReaderM m r => (r -> r) -> m a -> m a

-- | Modify the output of a computation.
mapWriter :: RunWriterM m w => (w -> w) -> m a -> m a

-- | Modify the exception that was risen by a computation.
mapException :: RunExceptionM m x => (x -> x) -> m a -> m a

-- | Apply the given exception handler, if a computation raises an
--   exception.
handle :: RunExceptionM m x => m a -> (x -> m a) -> m a

-- | A convenience type family for defining stacks of monads. The first
--   entry in the list is the top-most layer of the monad stack (i.e., the
--   one that is furtherest from the base). For example:
--   
--   
--   newtype M a = M { unM ::
--     WithBase IO
--       '[ ReaderT    Int
--        , StateT     Char
--        , ExceptionT String
--        ] a
--     }
--   
--   
--   is equivalent to:
--   
--   
--   newtype M a = M { unM ::
--     ReaderT    Int      (
--     StateT     Char     (
--     ExceptionT String
--     IO                  )) a
--     }
--   
type family WithBase (base :: Type -> Type) (layers :: [Type -> Type -> Type -> Type]) :: Type -> Type
instance MonadLib.AbortM m i => MonadLib.AbortM (MonadLib.ChoiceT m) i
instance GHC.Internal.Base.Monad m => MonadLib.AbortM (MonadLib.ContT i m) i
instance MonadLib.AbortM m i => MonadLib.AbortM (MonadLib.ExceptionT j m) i
instance MonadLib.AbortM GHC.Types.IO GHC.Internal.IO.Exception.ExitCode
instance MonadLib.AbortM m i => MonadLib.AbortM (MonadLib.IdT m) i
instance MonadLib.AbortM m i => MonadLib.AbortM (MonadLib.ReaderT j m) i
instance MonadLib.AbortM m i => MonadLib.AbortM (MonadLib.StateT j m) i
instance (MonadLib.AbortM m i, GHC.Internal.Base.Monoid j) => MonadLib.AbortM (MonadLib.WriterT j m) i
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Alternative (MonadLib.ChoiceT m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.Alternative (MonadLib.ContT i m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.Alternative (MonadLib.ExceptionT i m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.Alternative (MonadLib.IdT m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.Alternative (MonadLib.ReaderT i m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.Alternative (MonadLib.StateT i m)
instance (GHC.Internal.Base.MonadPlus m, GHC.Internal.Base.Monoid i) => GHC.Internal.Base.Alternative (MonadLib.WriterT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (MonadLib.ChoiceT m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (MonadLib.ContT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (MonadLib.ExceptionT i m)
instance GHC.Internal.Base.Applicative MonadLib.Id
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (MonadLib.IdT m)
instance GHC.Internal.Base.Applicative MonadLib.Lift
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (MonadLib.ReaderT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (MonadLib.StateT i m)
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid i) => GHC.Internal.Base.Applicative (MonadLib.WriterT i m)
instance MonadLib.BaseM m n => MonadLib.BaseM (MonadLib.ChoiceT m) n
instance MonadLib.BaseM m n => MonadLib.BaseM (MonadLib.ContT i m) n
instance MonadLib.BaseM m n => MonadLib.BaseM (MonadLib.ExceptionT i m) n
instance MonadLib.BaseM GHC.Types.IO GHC.Types.IO
instance MonadLib.BaseM MonadLib.Id MonadLib.Id
instance MonadLib.BaseM m n => MonadLib.BaseM (MonadLib.IdT m) n
instance MonadLib.BaseM MonadLib.Lift MonadLib.Lift
instance MonadLib.BaseM [] []
instance MonadLib.BaseM GHC.Internal.Maybe.Maybe GHC.Internal.Maybe.Maybe
instance MonadLib.BaseM m n => MonadLib.BaseM (MonadLib.ReaderT i m) n
instance MonadLib.BaseM (GHC.Internal.ST.ST s) (GHC.Internal.ST.ST s)
instance MonadLib.BaseM m n => MonadLib.BaseM (MonadLib.StateT i m) n
instance (MonadLib.BaseM m n, GHC.Internal.Base.Monoid i) => MonadLib.BaseM (MonadLib.WriterT i m) n
instance MonadLib.ContM m => MonadLib.ContM (MonadLib.ChoiceT m)
instance GHC.Internal.Base.Monad m => MonadLib.ContM (MonadLib.ContT i m)
instance MonadLib.ContM m => MonadLib.ContM (MonadLib.ExceptionT i m)
instance MonadLib.ContM m => MonadLib.ContM (MonadLib.IdT m)
instance MonadLib.ContM m => MonadLib.ContM (MonadLib.ReaderT i m)
instance MonadLib.ContM m => MonadLib.ContM (MonadLib.StateT i m)
instance (MonadLib.ContM m, GHC.Internal.Base.Monoid i) => MonadLib.ContM (MonadLib.WriterT i m)
instance MonadLib.ExceptionM m j => MonadLib.ExceptionM (MonadLib.ChoiceT m) j
instance MonadLib.ExceptionM m j => MonadLib.ExceptionM (MonadLib.ContT i m) j
instance GHC.Internal.Base.Monad m => MonadLib.ExceptionM (MonadLib.ExceptionT i m) i
instance MonadLib.ExceptionM GHC.Types.IO GHC.Internal.Exception.Type.SomeException
instance MonadLib.ExceptionM m j => MonadLib.ExceptionM (MonadLib.IdT m) j
instance MonadLib.ExceptionM m j => MonadLib.ExceptionM (MonadLib.ReaderT i m) j
instance MonadLib.ExceptionM m j => MonadLib.ExceptionM (MonadLib.StateT i m) j
instance (MonadLib.ExceptionM m j, GHC.Internal.Base.Monoid i) => MonadLib.ExceptionM (MonadLib.WriterT i m) j
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (MonadLib.ChoiceT m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (MonadLib.ContT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (MonadLib.ExceptionT i m)
instance GHC.Internal.Base.Functor MonadLib.Id
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (MonadLib.IdT m)
instance GHC.Internal.Base.Functor MonadLib.Lift
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (MonadLib.ReaderT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (MonadLib.StateT i m)
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid i) => GHC.Internal.Base.Functor (MonadLib.WriterT i m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (MonadLib.ChoiceT m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (MonadLib.ContT i m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (MonadLib.ExceptionT i m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (MonadLib.IdT m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (MonadLib.ReaderT i m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (MonadLib.StateT i m)
instance (GHC.Internal.Base.Monoid i, GHC.Internal.Control.Monad.Fail.MonadFail m) => GHC.Internal.Control.Monad.Fail.MonadFail (MonadLib.WriterT i m)
instance GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.ExceptionT i m)
instance GHC.Internal.Control.Monad.Fix.MonadFix MonadLib.Id
instance GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.IdT m)
instance GHC.Internal.Control.Monad.Fix.MonadFix MonadLib.Lift
instance GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.ReaderT i m)
instance GHC.Internal.Control.Monad.Fix.MonadFix m => GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.StateT i m)
instance (GHC.Internal.Control.Monad.Fix.MonadFix m, GHC.Internal.Base.Monoid i) => GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.WriterT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.MonadPlus (MonadLib.ChoiceT m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.MonadPlus (MonadLib.ContT i m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.MonadPlus (MonadLib.ExceptionT i m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.MonadPlus (MonadLib.IdT m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.MonadPlus (MonadLib.ReaderT i m)
instance GHC.Internal.Base.MonadPlus m => GHC.Internal.Base.MonadPlus (MonadLib.StateT i m)
instance (GHC.Internal.Base.MonadPlus m, GHC.Internal.Base.Monoid i) => GHC.Internal.Base.MonadPlus (MonadLib.WriterT i m)
instance MonadLib.MonadT MonadLib.ChoiceT
instance MonadLib.MonadT (MonadLib.ContT i)
instance MonadLib.MonadT (MonadLib.ExceptionT i)
instance MonadLib.MonadT MonadLib.IdT
instance MonadLib.MonadT (MonadLib.ReaderT i)
instance MonadLib.MonadT (MonadLib.StateT i)
instance GHC.Internal.Base.Monoid i => MonadLib.MonadT (MonadLib.WriterT i)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (MonadLib.ChoiceT m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (MonadLib.ContT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (MonadLib.ExceptionT i m)
instance GHC.Internal.Base.Monad MonadLib.Id
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (MonadLib.IdT m)
instance GHC.Internal.Base.Monad MonadLib.Lift
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (MonadLib.ReaderT i m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (MonadLib.StateT i m)
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid i) => GHC.Internal.Base.Monad (MonadLib.WriterT i m)
instance MonadLib.ReaderM m j => MonadLib.ReaderM (MonadLib.ChoiceT m) j
instance MonadLib.ReaderM m j => MonadLib.ReaderM (MonadLib.ContT i m) j
instance MonadLib.ReaderM m j => MonadLib.ReaderM (MonadLib.ExceptionT i m) j
instance MonadLib.ReaderM m j => MonadLib.ReaderM (MonadLib.IdT m) j
instance GHC.Internal.Base.Monad m => MonadLib.ReaderM (MonadLib.ReaderT i m) i
instance MonadLib.ReaderM m j => MonadLib.ReaderM (MonadLib.StateT i m) j
instance (MonadLib.ReaderM m j, GHC.Internal.Base.Monoid i) => MonadLib.ReaderM (MonadLib.WriterT i m) j
instance GHC.Internal.Base.Monad m => MonadLib.RunExceptionM (MonadLib.ExceptionT i m) i
instance MonadLib.RunExceptionM GHC.Types.IO GHC.Internal.Exception.Type.SomeException
instance MonadLib.RunExceptionM m i => MonadLib.RunExceptionM (MonadLib.IdT m) i
instance MonadLib.RunExceptionM m i => MonadLib.RunExceptionM (MonadLib.ReaderT j m) i
instance MonadLib.RunExceptionM m i => MonadLib.RunExceptionM (MonadLib.StateT j m) i
instance (MonadLib.RunExceptionM m i, GHC.Internal.Base.Monoid j) => MonadLib.RunExceptionM (MonadLib.WriterT j m) i
instance MonadLib.RunM m (GHC.Internal.Maybe.Maybe (a, MonadLib.ChoiceT m a)) r => MonadLib.RunM (MonadLib.ChoiceT m) a r
instance MonadLib.RunM m i r => MonadLib.RunM (MonadLib.ContT i m) a ((a -> m i) -> r)
instance MonadLib.RunM m (GHC.Internal.Data.Either.Either i a) r => MonadLib.RunM (MonadLib.ExceptionT i m) a r
instance MonadLib.RunM GHC.Types.IO a (GHC.Types.IO a)
instance MonadLib.RunM m a r => MonadLib.RunM (MonadLib.IdT m) a r
instance MonadLib.RunM MonadLib.Id a a
instance MonadLib.RunM MonadLib.Lift a a
instance MonadLib.RunM m a r => MonadLib.RunM (MonadLib.ReaderT i m) a (i -> r)
instance MonadLib.RunM m (a, i) r => MonadLib.RunM (MonadLib.StateT i m) a (i -> r)
instance (GHC.Internal.Base.Monoid i, MonadLib.RunM m (a, i) r) => MonadLib.RunM (MonadLib.WriterT i m) a r
instance MonadLib.RunReaderM m j => MonadLib.RunReaderM (MonadLib.ContT i m) j
instance MonadLib.RunReaderM m j => MonadLib.RunReaderM (MonadLib.ExceptionT i m) j
instance MonadLib.RunReaderM m j => MonadLib.RunReaderM (MonadLib.IdT m) j
instance GHC.Internal.Base.Monad m => MonadLib.RunReaderM (MonadLib.ReaderT i m) i
instance MonadLib.RunReaderM m j => MonadLib.RunReaderM (MonadLib.StateT i m) j
instance (MonadLib.RunReaderM m j, GHC.Internal.Base.Monoid i) => MonadLib.RunReaderM (MonadLib.WriterT i m) j
instance (MonadLib.RunWriterM m j, GHC.Internal.Control.Monad.Fix.MonadFix m) => MonadLib.RunWriterM (MonadLib.ContT i m) j
instance MonadLib.RunWriterM m j => MonadLib.RunWriterM (MonadLib.ExceptionT i m) j
instance MonadLib.RunWriterM m j => MonadLib.RunWriterM (MonadLib.IdT m) j
instance MonadLib.RunWriterM m j => MonadLib.RunWriterM (MonadLib.ReaderT i m) j
instance MonadLib.RunWriterM m j => MonadLib.RunWriterM (MonadLib.StateT i m) j
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid i) => MonadLib.RunWriterM (MonadLib.WriterT i m) i
instance MonadLib.StateM m j => MonadLib.StateM (MonadLib.ChoiceT m) j
instance MonadLib.StateM m j => MonadLib.StateM (MonadLib.ContT i m) j
instance MonadLib.StateM m j => MonadLib.StateM (MonadLib.ExceptionT i m) j
instance MonadLib.StateM m j => MonadLib.StateM (MonadLib.IdT m) j
instance MonadLib.StateM m j => MonadLib.StateM (MonadLib.ReaderT i m) j
instance GHC.Internal.Base.Monad m => MonadLib.StateM (MonadLib.StateT i m) i
instance (MonadLib.StateM m j, GHC.Internal.Base.Monoid i) => MonadLib.StateM (MonadLib.WriterT i m) j
instance MonadLib.WriterM m j => MonadLib.WriterM (MonadLib.ChoiceT m) j
instance MonadLib.WriterM m j => MonadLib.WriterM (MonadLib.ContT i m) j
instance MonadLib.WriterM m j => MonadLib.WriterM (MonadLib.ExceptionT i m) j
instance MonadLib.WriterM m j => MonadLib.WriterM (MonadLib.IdT m) j
instance MonadLib.WriterM m j => MonadLib.WriterM (MonadLib.ReaderT i m) j
instance MonadLib.WriterM m j => MonadLib.WriterM (MonadLib.StateT i m) j
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid i) => MonadLib.WriterM (MonadLib.WriterT i m) i

-- | This module defines a number of functions that make it easy to get the
--   functionality of MonadLib for user-defined newtypes.
module MonadLib.Derive

-- | An isomorphism between (usually) monads. Typically the constructor and
--   selector of a newtype delcaration.
data Iso (m :: Type -> Type) (n :: Type -> Type)
Iso :: (forall a. () => m a -> n a) -> (forall a. () => n a -> m a) -> Iso (m :: Type -> Type) (n :: Type -> Type)

-- | Derive the implementation of fmap from Functor.
derive_fmap :: forall (m :: Type -> Type) n a b. Functor m => Iso m n -> (a -> b) -> n a -> n b

-- | Derive the implementation of pure from Applicative.
derive_pure :: forall (m :: Type -> Type) n a. Applicative m => Iso m n -> a -> n a

-- | Derive the implementation of <*> from Applicative.
derive_apply :: forall (m :: Type -> Type) n a b. Applicative m => Iso m n -> n (a -> b) -> n a -> n b

-- | Derive the implementation of empty from Alternative.
derive_empty :: forall (m :: Type -> Type) n a. Alternative m => Iso m n -> n a

-- | Derive the implementation of <|> from Alternative.
derive_or :: forall (m :: Type -> Type) n a. Alternative m => Iso m n -> n a -> n a -> n a

-- | Derive the implementation of return from Monad.
derive_return :: forall (m :: Type -> Type) n a. Monad m => Iso m n -> a -> n a

-- | Derive the implementation of >>= from Monad.
derive_bind :: forall (m :: Type -> Type) n a b. Monad m => Iso m n -> n a -> (a -> n b) -> n b
derive_fail :: forall (m :: Type -> Type) n a. MonadFail m => Iso m n -> String -> n a

-- | Derive the implementation of mzero from MonadPlus.
derive_mzero :: forall (m :: Type -> Type) n a. MonadPlus m => Iso m n -> n a

-- | Derive the implementation of mplus from MonadPlus.
derive_mplus :: forall (m :: Type -> Type) n a. MonadPlus m => Iso m n -> n a -> n a -> n a

-- | Derive the implementation of mfix from MonadFix.
derive_mfix :: forall (m :: Type -> Type) n a. MonadFix m => Iso m n -> (a -> n a) -> n a

-- | Derive the implementation of ask from ReaderM.
derive_ask :: forall (m :: Type -> Type) i n. ReaderM m i => Iso m n -> n i

-- | Derive the implementation of local from RunReaderM.
derive_local :: forall (m :: Type -> Type) i n a. RunReaderM m i => Iso m n -> i -> n a -> n a

-- | Derive the implementation of put from WriterM.
derive_put :: forall (m :: Type -> Type) i n. WriterM m i => Iso m n -> i -> n ()

-- | Derive the implementation of collect from RunWriterM.
derive_collect :: forall (m :: Type -> Type) i n a. RunWriterM m i => Iso m n -> n a -> n (a, i)

-- | Derive the implementation of get from StateM.
derive_get :: forall (m :: Type -> Type) i n. StateM m i => Iso m n -> n i

-- | Derive the implementation of set from StateM.
derive_set :: forall (m :: Type -> Type) i n. StateM m i => Iso m n -> i -> n ()

-- | Derive the implementation of raise from ExceptionM.
derive_raise :: forall (m :: Type -> Type) i n a. ExceptionM m i => Iso m n -> i -> n a

-- | Derive the implementation of try from RunExceptionM.
derive_try :: forall (m :: Type -> Type) i n a. RunExceptionM m i => Iso m n -> n a -> n (Either i a)

-- | Derive the implementation of callWithCC from ContM.
derive_callWithCC :: forall (m :: Type -> Type) n a. ContM m => Iso m n -> ((a -> Label n) -> n a) -> n a
derive_abort :: forall (m :: Type -> Type) i n a. AbortM m i => Iso m n -> i -> n a

-- | Derive the implementation of lift from MonadT.
derive_lift :: forall (t :: (Type -> Type) -> Type -> Type) m n a. (MonadT t, Monad m) => Iso (t m) n -> m a -> n a

-- | Derive the implementation of inBase from BaseM.
derive_inBase :: forall (m :: Type -> Type) x n a. BaseM m x => Iso m n -> x a -> n a

-- | Derive the implementation of the runM function from
--   RunM.
derive_runM :: forall (m :: Type -> Type) a r n. RunM m a r => Iso m n -> n a -> r

-- | This module contains a collection of monads that are defined in terms
--   of the monad transformers from MonadLib. The definitions in
--   this module are completely mechanical and so this module may become
--   obsolete if support for automated derivations for instances becomes
--   well supported across implementations.
module MonadLib.Monads
data Reader i a
data Writer i a
data State i a
data Exception i a
data Cont i a
runReader :: i -> Reader i a -> a
runWriter :: Writer i a -> (a, i)
runState :: i -> State i a -> (a, i)
runException :: Exception i a -> Either i a
runCont :: (a -> i) -> Cont i a -> i
instance GHC.Internal.Base.Applicative (MonadLib.Monads.Cont i)
instance GHC.Internal.Base.Applicative (MonadLib.Monads.Exception i)
instance GHC.Internal.Base.Applicative (MonadLib.Monads.Reader i)
instance GHC.Internal.Base.Applicative (MonadLib.Monads.State i)
instance GHC.Internal.Base.Monoid i => GHC.Internal.Base.Applicative (MonadLib.Monads.Writer i)
instance MonadLib.BaseM (MonadLib.Monads.Cont i) (MonadLib.Monads.Cont i)
instance MonadLib.BaseM (MonadLib.Monads.Exception i) (MonadLib.Monads.Exception i)
instance MonadLib.BaseM (MonadLib.Monads.Reader i) (MonadLib.Monads.Reader i)
instance MonadLib.BaseM (MonadLib.Monads.State i) (MonadLib.Monads.State i)
instance GHC.Internal.Base.Monoid i => MonadLib.BaseM (MonadLib.Monads.Writer i) (MonadLib.Monads.Writer i)
instance MonadLib.ContM (MonadLib.Monads.Cont i)
instance MonadLib.ExceptionM (MonadLib.Monads.Exception i) i
instance GHC.Internal.Base.Functor (MonadLib.Monads.Cont i)
instance GHC.Internal.Base.Functor (MonadLib.Monads.Exception i)
instance GHC.Internal.Base.Functor (MonadLib.Monads.Reader i)
instance GHC.Internal.Base.Functor (MonadLib.Monads.State i)
instance GHC.Internal.Base.Monoid i => GHC.Internal.Base.Functor (MonadLib.Monads.Writer i)
instance GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.Monads.Exception i)
instance GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.Monads.Reader i)
instance GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.Monads.State i)
instance GHC.Internal.Base.Monoid i => GHC.Internal.Control.Monad.Fix.MonadFix (MonadLib.Monads.Writer i)
instance GHC.Internal.Base.Monad (MonadLib.Monads.Cont i)
instance GHC.Internal.Base.Monad (MonadLib.Monads.Exception i)
instance GHC.Internal.Base.Monad (MonadLib.Monads.Reader i)
instance GHC.Internal.Base.Monad (MonadLib.Monads.State i)
instance GHC.Internal.Base.Monoid i => GHC.Internal.Base.Monad (MonadLib.Monads.Writer i)
instance MonadLib.ReaderM (MonadLib.Monads.Reader i) i
instance MonadLib.RunExceptionM (MonadLib.Monads.Exception i) i
instance MonadLib.RunReaderM (MonadLib.Monads.Reader i) i
instance GHC.Internal.Base.Monoid i => MonadLib.RunWriterM (MonadLib.Monads.Writer i) i
instance MonadLib.StateM (MonadLib.Monads.State i) i
instance GHC.Internal.Base.Monoid i => MonadLib.WriterM (MonadLib.Monads.Writer i) i
