traceM and traceShowM

Joachim Breitner mail at
Sat Oct 17 13:21:49 EDT 2009


Am Freitag, den 16.10.2009, 15:22 +0200 schrieb Martijn van Steenbergen:
> 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

thanks to your mail I found out about traceShow. This does save some
time, but I still find myself inserting
	(\x -> trace (show x) x) 
or now
	(\x -> traceShow x x)
into chained functions.

If Debug.Trace, Control.Monad.Instances and Control.Monad happend to be
in scope, this can be abbreviated by 
	join traceShow :: (Show a) => a -> a
but maybe with a good name, this would be useful in Debug.Trace
directly? I’d really appreciate such a function when debugging code
written in points-free style.


Joachim "nomeata" Breitner
  mail: mail at | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata at |
  Debian Developer: nomeata at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url :

More information about the Libraries mailing list