
5 Nov
2009
5 Nov
'09
12:34 p.m.
Philip K.F. Hölzenspies wrote:
As a post-deadline suggestion to fix Simon's (valid) reservation:
traceShowM :: (Show a, Monad m) => a -> m a traceShowM a = traceM (show a) a
This allows easier trace insertion, e.g.:
I disagree. I think it's easier to remove/comment/uncomment (which you do often with trace statements) a whole line than part of a line. On the other hand, you can still use this function as a standalone line. But I don't like having monadic functions return something when that's not necessary, even though I cannot think of a clear argument against it at the moment. :-( So I guess either way is fine. Does anyone else know any criteria to decide one way or another? Martijn.