traceM and traceShowM

Martijn van Steenbergen martijn at van.steenbergen.nl
Thu Nov 5 07:25:13 EST 2009


Simon Marlow wrote:
> On 16/10/2009 14:22, Martijn van Steenbergen wrote:
>> Hello,
>>
>> I propose the addition of the following two functions to module
>> Debug.Trace:
>>
>>> traceM :: Monad m => String -> m ()
>>> traceM msg = trace msg (return ())
>>>
>>> traceShowM :: (Show a, Monad m) => a -> m ()
>>> traceShowM = traceM . show
> 
> is traceShowM really necessary?  It doesn't save many characters, and 
> fails the "don't name a composition" test.

No, it's not necessary at all.

There's a bit of tension between not wanting to name a composition and 
being consistent with the rest of the module: traceM and traceShowM 
mirror the existing trace and traceShow functions.

Martijn.


More information about the Libraries mailing list