polysemy-zoo-0.7.0.2: 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 

Instances

Instances details
type DefiningModule (EndState :: k1 -> k2 -> k1 -> Type) Source # 
Instance details

Defined in Polysemy.EndState

type DefiningModule (EndState :: k1 -> k2 -> k1 -> Type) = "Polysemy.EndState"

Actions

getEndState :: forall s r. MemberWithError (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.