traceM and traceShowM

Joachim Breitner mail at joachim-breitner.de
Sat Oct 17 13:21:49 EDT 2009


Hi,

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.

Greetings,
Joachim



-- 
Joachim "nomeata" Breitner
  mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata at debian.org
-------------- 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 : http://www.haskell.org/pipermail/libraries/attachments/20091017/adfc320e/attachment.bin


More information about the Libraries mailing list