Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Writer w (m :: * -> *) k = Tell w k
- tell :: (Member (Writer w) sig, Carrier sig m) => w -> m ()
- runWriter :: (Carrier sig m, Effect sig, Functor m, Monoid w) => Eff (WriterC w m) a -> m (w, a)
- execWriter :: (Carrier sig m, Effect sig, Functor m, Monoid w) => Eff (WriterC w m) a -> m w
- newtype WriterC w m a = WriterC {
- runWriterC :: m (w, a)
Documentation
data Writer w (m :: * -> *) k Source #
Tell w k |
tell :: (Member (Writer w) sig, Carrier sig m) => w -> m () Source #
Write a value to the log.
fst (run (runWriter (mapM_ (tell . Sum) (0 : ws)))) == foldMap Sum ws
runWriter :: (Carrier sig m, Effect sig, Functor m, Monoid w) => Eff (WriterC w m) a -> m (w, a) Source #
execWriter :: (Carrier sig m, Effect sig, Functor m, Monoid w) => Eff (WriterC w m) a -> m w Source #
newtype WriterC w m a Source #
WriterC | |
|