std.effect.writer

Implementation of the Writer effect

Types

type Writer s r a = 
    | Tell : s -> Writer s r ()
    .. r

The Writer effect allows the computations to output values of type s

Values

let tell s : forall r . forall s . s -> Eff [| writer : Writer s | r |] ()

Outputs s

let run_writer eff : forall a r .
        forall s .
            [Monoid s]
                -> Eff [| writer : Writer s | r |] a
                -> Eff [| | r |] { value : a, writer : s }

Eliminates Writer, returning the output and computed value. Each output through tell are joined via its Monoid instance