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

Safe HaskellNone
LanguageHaskell2010

Polysemy.Final.More

Synopsis

Documentation

runFinalSem :: Sem (Final (Sem r) ': r) a -> Sem r a Source #

Run a Final (Sem r) effect if the remaining effect stack is r.

This is sometimes useful for interpreters that make use of reinterpret, raiseUnder, or any of their friends.

lowerFinal :: Member (Embed m) r => (forall x. Sem r x -> m x) -> Sem (Final m ': r) a -> Sem r a Source #

Run a Final m effect by providing an explicit lowering function.

Beware: The lowering function may be invoked multiple times, so don't do any initialization work inside the lowering function: it will be duplicated.