polysemy-0.1.2.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 => Sem r i Source #

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

local :: forall i a. forall r. Member (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

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

Transform an Input effect into a Reader effect.