Ben Escoto wrote:
Hi all, does anyone have any tips on how to insert debugging or
logging statements through a program?  Here are two possibilities:

another thing I found quite useful is to add a component { .. , info :: Doc } to my data types, and then set its value at each function call:

f x y = ( ... ) { info = parens $ fsep [ text "f", info x, info y ] }

( I figure this is sort of part of what
some tools can do automatically? )

that way you always know who built what.
and it's cheap - if you don't use this information,
then it's never created (due to laziness).

best regards,
--
-- Johannes Waldmann,  Tel/Fax: (0341) 3076 6479 / 6480 --
------ http://www.imn.htwk-leipzig.de/~waldmann/ ---------


_______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Reply via email to