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.