| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Effect.Writer.Strict
Documentation
module Control.Effect.Writer
runWriter :: Monoid w => Eff (Writer w ': effs) a -> Eff effs (w, a) Source #
Handles a effect, strictly accumulating the monoidal state.Writer
Note that the state will be accumulated via left-associated uses of <>.
This is necessary to be strict, but it can be catastrophically slow on
certain monoids, most notably []. To avoid pathological performance, use a
data structure that supports efficient appends, such as Data.Sequence.Seq,
or use Dual to flip the argument order of <> (but beware
that this will cause the elements to be accumulated in reverse order).