I\'m not even sure this is possible in any kind of monad; does it violate monad laws? But it seems like something that should be possible in some kind of construct or other. S
There are a lot of logger libraries.
If you are interested in Monad-Logger - here you are: Control.Monad.Logger
And at the Hackage you could find other libraries