polysemy-0.1.1.0: Higher-order, low-boilerplate, zero-cost free monads.

Safe HaskellNone
LanguageHaskell2010

Polysemy.Reader

Contents

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
type DefiningModule Reader Source # 
Instance details

Defined in Polysemy.Reader

type DefiningModule Reader = "Polysemy.Reader"

Actions

ask :: forall i. forall r. Member (Reader i) r => Semantic r i Source #

asks :: Member (Reader i) r => (i -> j) -> Semantic r j Source #

local :: forall i a. forall r. Member (Reader i) r => (i -> i) -> Semantic r a -> Semantic r a Source #

Interpretations

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

Run a Reader effect with a constant value.

runInputAsReader :: Semantic (Input i ': r) a -> Semantic (Reader i ': r) a Source #

Transform an Input effect into a Reader effect.