polysemy-1.6.0.0: Higher-order, low-boilerplate free monads.
Safe HaskellNone
LanguageHaskell2010

Polysemy.Reader

Synopsis

Effect

data Reader i m a where Source #

An effect corresponding to ReaderT.

Constructors

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

Instances

Instances details
type DefiningModule Reader Source # 
Instance details

Defined in Polysemy.Reader

type DefiningModule Reader = "Polysemy.Reader"

Actions

ask :: forall i r. MemberWithError (Reader i) r => Sem r i Source #

asks :: forall i j r. Member (Reader i) r => (i -> j) -> Sem r j Source #

local :: forall i r a. MemberWithError (Reader i) r => (i -> i) -> Sem r a -> Sem r a Source #

Interpretations

runReader :: i -> Sem (Reader i ': r) a -> Sem r a Source #

Run a Reader effect with a constant value.

Interpretations for Other Effects

inputToReader :: Member (Reader i) r => Sem (Input i ': r) a -> Sem r a Source #

Transform an Input effect into a Reader effect.

Since: 1.0.0.0