Modulepolysemy-1.9.2.0Haskell2010
Polysemy.Output
- 1 type
- 14 values
- Packagepolysemy-1.9.2.0
- Exports15
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceOutput.hs
Effect
1 declarationActions
1 declarationOutput a message.
Interpretations
13 declarationsRun an Output effect by transforming it into a list of its values.
Run an Output effect by transforming it into a monoid.
Like runOutputMonoid, 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 runOutputMonoid if the monoid is a list, such as String.
Like runLazyOutputMonoid, 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 runLazyOutputMonoid if the monoid is a list, such as String.
Warning: This inherits the nasty space leak issue of WriterT! Don't use this if you don't have to.
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 ignoring it.
Runs an Output effect by running a monadic action for each of its values.