polysemy-zoo-0.5.0.1: Experimental, user-contributed effects and interpreters for polysemy

Safe HaskellNone
LanguageHaskell2010

Polysemy.Final.MTL

Synopsis

Documentation

runErrorFinal :: (Member (Final m) r, MonadError e m) => Sem (Error e ': r) a -> Sem r a Source #

Run an Error effect through a final MonadError

Beware: Effects that aren't interpreted in terms of the final monad will have local state semantics in regards to Error effects interpreted this way. See interpretFinal.

runReaderFinal :: (Member (Final m) r, MonadReader i m) => Sem (Reader i ': r) a -> Sem r a Source #

Run a Reader effect through a final MonadReader

Beware: Effects that aren't interpreted in terms of the final monad will have local state semantics in regards to Reader effects interpreted this way. See interpretFinal.

runStateFinal :: (Member (Embed m) r, MonadState s m) => Sem (State s ': r) a -> Sem r a Source #

Run a State effect through a MonadState

Despite the name, the target monad need not actually be the final monad. The "-Final" suffix reflects that this interpreter has the unusual semantics of interpreters that runs effects by embedding them into another monad.

Beware: Effects that aren't interpreted in terms of the final monad will have local state semantics in regards to State effects interpreted this way. See interpretFinal.

runWriterFinal :: (Member (Final m) r, MonadWriter o m) => Sem (Writer o ': r) a -> Sem r a Source #

Run a Writer effect through a final MonadWriter

Beware: Effects that aren't interpreted in terms of the final monad will have local state semantics in regards to Writer effects interpreted this way. See interpretFinal.