Module

Uncurried.Writer

Package
purescript-uncurried-transformers
Repository
PureFunctor/purescript-uncurried-transformers

This modules defines the writer monad, Writer.

#Writer Source

type Writer s = WriterT s Identity

A type synonym for a WriterT with Identity as its base monad.

#writer Source

writer :: forall w a. Monoid w => (a /\ w) -> Writer w a

Create a Writer monad from a pair of a result and an accumulator.

#runWriter Source

runWriter :: forall w a. Monoid w => Writer w a -> (a /\ w)

Runs a computation inside of Writer.

#evalWriter Source

evalWriter :: forall w a. Monoid w => Writer w a -> a

Runs a computation inside of Writer, discarding the final accumulator.

#execWriter Source

execWriter :: forall w a. Monoid w => Writer w a -> w

Runs a computation inside of Writer, discarding the final result.

#mapWriter Source

mapWriter :: forall w1 w2 a b. Monoid w1 => Monoid w2 => ((a /\ w1) -> (b /\ w2)) -> Writer w1 a -> Writer w2 b

Modifies the result and accumulator types of a Writer.