-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Methods for composing monads. -- -- Methods for composing monads. -- -- The I/O monad transformer, PlusMonad, and Linear modules are -- deprecated. Their use is discouraged. This package is now about -- automatic monad lifting; and includes a rigorous implementation of -- Luth and Ghani coproducts structured around the Free monad. @package MonadCompose @version 0.9.0.0 -- | Eta inverses for some vernacular monads. module Control.Monad.EtaInverse class (Monad f) => EtaInverse f etaInv :: EtaInverse f => f t -> Maybe t instance Control.Monad.EtaInverse.EtaInverse Data.Functor.Identity.Identity instance (GHC.Base.Monoid s, GHC.Classes.Eq s) => Control.Monad.EtaInverse.EtaInverse ((,) s) instance (GHC.Base.Monoid s, GHC.Classes.Eq s, Control.Monad.EtaInverse.EtaInverse f) => Control.Monad.EtaInverse.EtaInverse (Control.Monad.Trans.Writer.Lazy.WriterT s f) instance Control.Monad.EtaInverse.EtaInverse GHC.Maybe.Maybe instance Control.Monad.EtaInverse.EtaInverse [] instance Control.Monad.EtaInverse.EtaInverse f => Control.Monad.EtaInverse.EtaInverse (Control.Monad.Trans.Maybe.MaybeT f) instance GHC.Base.Functor f => Control.Monad.EtaInverse.EtaInverse (Control.Monad.Free.Free f) instance (GHC.Base.Functor f, Control.Monad.EtaInverse.EtaInverse f2) => Control.Monad.EtaInverse.EtaInverse (Control.Monad.Trans.Free.FreeT f f2) -- | This *is* monad coproducts (due to Luth and Ghani) unlike the other -- thing. module Control.Monad.Coproducts3 -- | A modified free monad giving efficient access to the topmost layer; -- but otherwise using the machinery of the free monad f2. data Free' f f2 t Free' :: f (f2 t) -> Free' f f2 t [unFree'] :: Free' f f2 t -> f (f2 t) Pure' :: t -> Free' f f2 t -- | A projection into the underlying free monad construction. toF2 :: MonadFree f m => Free' f m a -> m a -- | Given a free construction construct a representation of the monad -- coproduct in a free mona; it picks out one representative element of -- each equivalence class in the defining quotient of the monad -- coproduct. execCoproduct :: (EtaInverse f, EtaInverse f2, MonadFree (Sum f f2) f3) => Free (Sum f f2) t -> Free' (Sum f f2) f3 t instance (GHC.Base.Functor f, GHC.Base.Functor f2) => GHC.Base.Functor (Control.Monad.Coproducts3.Free' f f2) instance (Data.Functor.Classes.Show1 f, Data.Functor.Classes.Show1 f2) => Data.Functor.Classes.Show1 (Control.Monad.Coproducts3.Free' f f2) instance (GHC.Show.Show (f (f2 t)), GHC.Show.Show (f2 t), GHC.Show.Show t) => GHC.Show.Show (Control.Monad.Coproducts3.Free' f f2 t) instance (GHC.Base.Functor f, Control.Monad.Free.Class.MonadFree f f2) => GHC.Base.Monad (Control.Monad.Coproducts3.Free' f f2) instance (GHC.Base.Functor f, Control.Monad.Free.Class.MonadFree f f2) => GHC.Base.Applicative (Control.Monad.Coproducts3.Free' f f2) instance (GHC.Base.Functor f, Control.Monad.Free.Class.MonadFree f f2) => Control.Monad.Free.Class.MonadFree f (Control.Monad.Coproducts3.Free' f f2) module Control.Monad.Lifter -- | An automatic lifter. The idea of automatic lifting is due to Dan -- Piponi. class Lifter m n lf :: Lifter m n => m t -> n t instance Control.Monad.Lifter.Lifter (GHC.ST.ST GHC.Prim.RealWorld) GHC.Types.IO instance Control.Monad.Lifter.Lifter GHC.Types.IO GHC.Types.IO instance Control.Monad.Lifter.Lifter (GHC.ST.ST s) (GHC.ST.ST s) instance Control.Monad.Lifter.Lifter Data.Functor.Identity.Identity Data.Functor.Identity.Identity instance (Control.Monad.Trans.Class.MonadTrans n, GHC.Base.Monad x, Control.Monad.Lifter.Lifter m x) => Control.Monad.Lifter.Lifter m (n x) instance (GHC.Base.Monad x, Control.Monad.Morph.MFunctor m) => Control.Monad.Lifter.Lifter (m Data.Functor.Identity.Identity) (m x)