News for hackers. Stuff that matters.
Re:Ask HN: How would you do this in Haskell? by Tyr42 on Wednesday April 22, 2015 @02:06PM (#9422290)
This is exactly where you might like to use the writer monad. Check out LYAH http://learnyouahaskell.com/for-a-few-monads-more

It's just a fancy name for composing functions of the form `a -> (b, String)`, via

    (>>=) :: (a, String) -> (a -> (b, String)) -> (b, String)
    (a, log1) >>= f = let (b, log2) = f a in
                      (b, log1 ++ log2).

There are no comments on this comment yet.