Ben Escoto <[EMAIL PROTECTED]> wrote, > Hi all, does anyone have any tips on how to insert debugging or > logging statements through a program? Here are two possibilities: [..] > 2. Use unsafePerformIO or similar. But then your code is regularly > defeating the type system, which presumably isn't good. Also the > ghc manual has special instructions for compiling code that uses > unsafePerformIO, intimating that it isn't used very often.
There is `Debug.Trace.trace' for this: http://haskell.org/ghc/docs/latest/html/base/Debug.Trace.html However, if you want to log as opposed to debug, you may want to have the output go to somewhere else but stdout. Hence, it might be useful to have a variant of the `trace' that takes an explicit file handle in the library. Cheers, Manuel _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
