IO package:polysemy

Run an Async effect in terms of async through final IO. Beware: Effects that aren't interpreted in terms of IO will have local state semantics in regards to Async effects interpreted this way. See Final.
Run an AtomicState effect in terms of atomic operations in IO. Internally, this simply creates a new IORef, passes it to runAtomicStateIORef, and then returns the result and the final value of the IORef. Beware: As this uses an IORef internally, all other effects will have local state semantics in regards to AtomicState effects interpreted this way. For example, throw and catch will never revert atomicModifys, even if runError is used after atomicStateToIO.
Run an AtomicState effect by transforming it into atomic operations over an IORef.
Run an Error effect as an IO Exception through final IO. This interpretation is significantly faster than runError. Beware: Effects that aren't interpreted in terms of IO will have local state semantics in regards to Error effects interpreted this way. See Final.
Lift an exception generated from an IO action into an Error.
Run a Sem r action, converting any IO exception generated by it into an Error.
Like fromExceptionSem, but with the ability to transform the exception before turning it into an Error.
Like fromException, but with the ability to transform the exception before turning it into an Error.
The MonadIO class is conceptually an interpretation of IO to some other monad. This function reifies that intuition, by transforming an IO effect into some other MonadIO. This function is especially useful when using the MonadIO instance for Sem instance. Make sure to type-apply the desired MonadIO instance when using embedToMonadIO.

Example

foo :: PandocIO ()
foo = runM . embedToMonadIO @PandocIO $ do
liftIO $ putStrLn "hello from polysemy"
Fail the Q monad whenever the given Extensions aren't enabled in the current module.
Name of type variable parameterizing Sem
An extensible, type-safe union. The r type parameter is a type-level list of effects, any one of which may be held within the Union.
A variant of runWriterTVar where an STM action is used instead of a TVar to commit tells.
Run an Output effect in terms of atomic operations in IO. Internally, this simply creates a new IORef, passes it to runOutputMonoidIORef, and then returns the result and the final value of the IORef. Beware: As this uses an IORef internally, all other effects will have local state semantics in regards to Output effects interpreted this way. For example, throw and catch will never revert outputs, even if runError is used after outputToIOMonoid.
Like outputToIOMonoid, but right-associates uses of <>. This asymptotically improves performance if the time complexity of <> for the Monoid depends only on the size of the first argument. You should always use this instead of outputToIOMonoid if the monoid is a list, such as String. Beware: As this uses an IORef internally, all other effects will have local state semantics in regards to Output effects interpreted this way. For example, throw and catch will never revert outputs, even if runError is used after outputToIOMonoidAssocR.
Run an Output effect by transforming it into atomic operations over an IORef.
Like bracketOnError, but for the simple case of one computation to run afterward.