polysemy-1.9.1.0: Higher-order, low-boilerplate free monads.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Reader

Description

 
Synopsis

Effect

data Reader i m a where Source #

An effect corresponding to ReaderT.

Constructors

Ask :: Reader i m i

Get the environment.

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

Transform the environment.

Actions

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

Get the environment.

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

Apply a function to the environment and return the result.

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

Transform the environment.

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