monad-introspect-0.1.0.0: A reader monad that gives the environment access to the entire transformer stack

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Trans.Introspect

Contents

Synopsis

Concrete interface

newtype IntrospectT (t :: (* -> *) -> * -> *) (r :: (* -> *) -> *) (m :: * -> *) (a :: *) Source #

IntrospectT t r m a extends the monad m with access to an environment r parameterized by m with additional effects t on top.

Constructors

IntrospectT 

Fields

Instances
(Monad m, MonadTrans t) => MonadIntrospectTrans t r (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

introspectTrans :: IntrospectT t r m (r (t (IntrospectT t r m))) Source #

substituteTrans :: (r (t (IntrospectT t r m)) -> r (t (IntrospectT t r m))) -> IntrospectT t r m a -> IntrospectT t r m a Source #

MonadWriter w m => MonadWriter w (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

writer :: (a, w) -> IntrospectT t r m a #

tell :: w -> IntrospectT t r m () #

listen :: IntrospectT t r m a -> IntrospectT t r m (a, w) #

pass :: IntrospectT t r m (a, w -> w) -> IntrospectT t r m a #

MonadState s m => MonadState s (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

get :: IntrospectT t r m s #

put :: s -> IntrospectT t r m () #

state :: (s -> (a, s)) -> IntrospectT t r m a #

MonadReader e m => MonadReader e (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

ask :: IntrospectT t r m e #

local :: (e -> e) -> IntrospectT t r m a -> IntrospectT t r m a #

reader :: (e -> a) -> IntrospectT t r m a #

MonadError e m => MonadError e (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

throwError :: e -> IntrospectT t r m a #

catchError :: IntrospectT t r m a -> (e -> IntrospectT t r m a) -> IntrospectT t r m a #

MonadTrans (IntrospectT t r) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

lift :: Monad m => m a -> IntrospectT t r m a #

Monad m => Monad (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

(>>=) :: IntrospectT t r m a -> (a -> IntrospectT t r m b) -> IntrospectT t r m b #

(>>) :: IntrospectT t r m a -> IntrospectT t r m b -> IntrospectT t r m b #

return :: a -> IntrospectT t r m a #

fail :: String -> IntrospectT t r m a #

Functor m => Functor (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

fmap :: (a -> b) -> IntrospectT t r m a -> IntrospectT t r m b #

(<$) :: a -> IntrospectT t r m b -> IntrospectT t r m a #

MonadFix m => MonadFix (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

mfix :: (a -> IntrospectT t r m a) -> IntrospectT t r m a #

MonadFail m => MonadFail (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

fail :: String -> IntrospectT t r m a #

Applicative m => Applicative (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

pure :: a -> IntrospectT t r m a #

(<*>) :: IntrospectT t r m (a -> b) -> IntrospectT t r m a -> IntrospectT t r m b #

liftA2 :: (a -> b -> c) -> IntrospectT t r m a -> IntrospectT t r m b -> IntrospectT t r m c #

(*>) :: IntrospectT t r m a -> IntrospectT t r m b -> IntrospectT t r m b #

(<*) :: IntrospectT t r m a -> IntrospectT t r m b -> IntrospectT t r m a #

MonadZip m => MonadZip (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

mzip :: IntrospectT t r m a -> IntrospectT t r m b -> IntrospectT t r m (a, b) #

mzipWith :: (a -> b -> c) -> IntrospectT t r m a -> IntrospectT t r m b -> IntrospectT t r m c #

munzip :: IntrospectT t r m (a, b) -> (IntrospectT t r m a, IntrospectT t r m b) #

MonadIO m => MonadIO (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

liftIO :: IO a -> IntrospectT t r m a #

Alternative m => Alternative (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

empty :: IntrospectT t r m a #

(<|>) :: IntrospectT t r m a -> IntrospectT t r m a -> IntrospectT t r m a #

some :: IntrospectT t r m a -> IntrospectT t r m [a] #

many :: IntrospectT t r m a -> IntrospectT t r m [a] #

MonadPlus m => MonadPlus (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

mzero :: IntrospectT t r m a #

mplus :: IntrospectT t r m a -> IntrospectT t r m a -> IntrospectT t r m a #

MonadCont m => MonadCont (IntrospectT t r m) Source # 
Instance details

Defined in Control.Monad.Trans.Introspect

Methods

callCC :: ((a -> IntrospectT t r m b) -> IntrospectT t r m a) -> IntrospectT t r m a #

runIntrospect :: (Representational r, Coercible (t (IntrospectT t r m)) n) => r n -> IntrospectT t r m a -> m a Source #

Run an IntrospectT. If introspection is the outermost effect then you will likely have t ~ IdentityT and thus you can pick n ~ IntrospectT t r m.

Utility functions for proxying other effects

mapIntrospectT :: (m a -> m b) -> IntrospectT t r m a -> IntrospectT t r m b Source #

liftCallCC :: CallCC m a b -> CallCC (IntrospectT t r m) a b Source #

liftCatch :: Catch e m a -> Catch e (IntrospectT t r m) a Source #