Polysemy: Changing return
Polysemy provides some interpreters changing the returned value:
The easiest way to acheive that is to use State
:
runWriter
:: Monoid o
=> Sem (Writer o ': r) a
-> Sem r (o, a)
runWriter = runState mempty . reinterpretH intr