in-other-words-0.1.0.0: A higher-order effect system where the sky's the limit

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Internal.Reader

Synopsis

Documentation

data Ask i m a where Source #

An effect for gaining access to information.

Constructors

Ask :: Ask i m i 

data Local i m a where Source #

An effect for locally modifying an environment used to gain access to information.

Constructors

Local :: (i -> i) -> m a -> Local i m a 

type Reader i = Bundle [Local i, Ask i] Source #

A pseudo-effect for connected Ask i and Local i effects.

Reader should only ever be used inside of Eff and Effs constraints. It is not a real effect! See Bundle.

newtype ReaderC i m a Source #

Constructors

ReaderC 

Fields

Instances
MonadBase b m => MonadBase b (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

liftBase :: b α -> ReaderC i m α #

MonadBaseControl b m => MonadBaseControl b (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Associated Types

type StM (ReaderC i m) a :: Type #

Methods

liftBaseWith :: (RunInBase (ReaderC i m) b -> b a) -> ReaderC i m a #

restoreM :: StM (ReaderC i m) a -> ReaderC i m a #

MonadTrans (ReaderC i) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

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

MonadTransControl (ReaderC i) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Associated Types

type StT (ReaderC i) a :: Type #

Methods

liftWith :: Monad m => (Run (ReaderC i) -> m a) -> ReaderC i m a #

restoreT :: Monad m => m (StT (ReaderC i) a) -> ReaderC i m a #

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

Defined in Control.Effect.Internal.Reader

Methods

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

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

return :: a -> ReaderC i m a #

fail :: String -> ReaderC i m a #

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

Defined in Control.Effect.Internal.Reader

Methods

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

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

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

Defined in Control.Effect.Internal.Reader

Methods

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

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

Defined in Control.Effect.Internal.Reader

Methods

fail :: String -> ReaderC i m a #

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

Defined in Control.Effect.Internal.Reader

Methods

pure :: a -> ReaderC i m a #

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

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

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

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

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

Defined in Control.Effect.Internal.Reader

Methods

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

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

Defined in Control.Effect.Internal.Reader

Methods

empty :: ReaderC i m a #

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

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

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

MonadPlus m => MonadPlus (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

mzero :: ReaderC i m a #

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

MonadThrow m => MonadThrow (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

throwM :: Exception e => e -> ReaderC i m a #

MonadCatch m => MonadCatch (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

catch :: Exception e => ReaderC i m a -> (e -> ReaderC i m a) -> ReaderC i m a #

MonadMask m => MonadMask (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

mask :: ((forall a. ReaderC i m a -> ReaderC i m a) -> ReaderC i m b) -> ReaderC i m b #

uninterruptibleMask :: ((forall a. ReaderC i m a -> ReaderC i m a) -> ReaderC i m b) -> ReaderC i m b #

generalBracket :: ReaderC i m a -> (a -> ExitCase b -> ReaderC i m c) -> (a -> ReaderC i m b) -> ReaderC i m (b, c) #

(Threads (ReaderT i) (Prims m), Carrier m) => Carrier (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Associated Types

type Derivs (ReaderC i m) :: [Effect] Source #

type Prims (ReaderC i m) :: [Effect] Source #

type StT (ReaderC i) a Source # 
Instance details

Defined in Control.Effect.Internal.Reader

type StT (ReaderC i) a = StT (ReaderT i) a
type Derivs (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

type Derivs (ReaderC i m) = (Local i :: (Type -> Type) -> Type -> Type) ': ((Ask i :: (Type -> Type) -> Type -> Type) ': Derivs m)
type Prims (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

type Prims (ReaderC i m) = ReaderPrim i ': Prims m
type StM (ReaderC i m) a Source # 
Instance details

Defined in Control.Effect.Internal.Reader

type StM (ReaderC i m) a = StM (ReaderT i m) a