polysemy-zoo-0.8.1.0: Experimental, user-contributed effects and interpreters for polysemy
Safe HaskellNone
LanguageHaskell2010

Polysemy.EndState

Synopsis

Effect

data EndState s m a where Source #

An effect for getting the end state of a computation in advance.

Constructors

GetEndState :: EndState s m s 

Actions

getEndState :: forall s r. Member (EndState s) r => Sem r s Source #

Interpretations

runEndState :: forall s r a. (Member (State s) r, Member Fixpoint r) => Sem (EndState s ': r) a -> Sem r a Source #

Runs an EndState effect by getting the state after the computation has finished, and providing it recursively back to calls of getEndState.

runEndAtomicState :: forall s r a. (Member (AtomicState s) r, Member Fixpoint r) => Sem (EndState s ': r) a -> Sem r a Source #

Like runEndState, but for AtomicState rather than State.