I have a monad for a computation that may fail and does some logging:
f1 :: WriterT [String] (Either String) a
I have a function that will not fail but does some logging:
f2 :: Writer [String] b
What's the best way to update the writer monad in f1 using the log from f2, and capture the output of the f2 computation? At the moment I'm doing this:
f2result <- (\(r,l) -> do {tell l; return r}) (runWriter f2)
I am using lift to update the inner monad with a different computation, so switching around the Writer and Either monads will not solve the problem.