fused-effects-1.1.2.2: A fast, flexible, fused effect system.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Carrier.Reader

Description

A carrier for Reader effects.

Since: 1.0.0.0

Synopsis

Reader carrier

runReader :: r -> ReaderC r m a -> m a Source #

Run a Reader effect with the passed environment value.

runReader a ask = pure a
runReader a (pure b) = pure b
runReader a (local f m) = runReader (f a) m

Since: 1.0.0.0

newtype ReaderC r m a Source #

Since: 1.0.0.0

Constructors

ReaderC (r -> m a) 

Instances

Instances details
MonadTrans (ReaderC r) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

lift :: Monad m => m a -> ReaderC r m a #

MonadFail m => MonadFail (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

fail :: String -> ReaderC r m a #

MonadFix m => MonadFix (ReaderC s m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

mfix :: (a -> ReaderC s m a) -> ReaderC s m a #

MonadIO m => MonadIO (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

liftIO :: IO a -> ReaderC r m a #

Alternative m => Alternative (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

empty :: ReaderC r m a #

(<|>) :: ReaderC r m a -> ReaderC r m a -> ReaderC r m a #

some :: ReaderC r m a -> ReaderC r m [a] #

many :: ReaderC r m a -> ReaderC r m [a] #

Applicative m => Applicative (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

pure :: a -> ReaderC r m a #

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

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

(*>) :: ReaderC r m a -> ReaderC r m b -> ReaderC r m b #

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

Functor m => Functor (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

fmap :: (a -> b) -> ReaderC r m a -> ReaderC r m b #

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

Monad m => Monad (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

(>>=) :: ReaderC r m a -> (a -> ReaderC r m b) -> ReaderC r m b #

(>>) :: ReaderC r m a -> ReaderC r m b -> ReaderC r m b #

return :: a -> ReaderC r m a #

(Alternative m, Monad m) => MonadPlus (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

mzero :: ReaderC r m a #

mplus :: ReaderC r m a -> ReaderC r m a -> ReaderC r m a #

MonadUnliftIO m => MonadUnliftIO (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

withRunInIO :: ((forall a. ReaderC r m a -> IO a) -> IO b) -> ReaderC r m b #

Algebra sig m => Algebra (Reader r :+: sig) (ReaderC r m) Source # 
Instance details

Defined in Control.Carrier.Reader

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (ReaderC r m) -> (Reader r :+: sig) n a -> ctx () -> ReaderC r m (ctx a) Source #

Reader effect