16 Nov
2003
16 Nov
'03
7:21 p.m.
Ben Escoto <bescoto@stanford.edu> writes:
Hi all, does anyone have any tips on how to insert debugging or logging statements through a program?
1. Use some kind of logging monad.
2. Use unsafePerformIO or similar.
It seems this must come up a lot when writing Haskell programs. What do most pople do?
The latter. In my case, it's more for debugging than logging, so I can live with somewhat weak guarantees. If you need to do it more properly, the simple solution might be to limit logging to when you're in the IO monad anyway? -kzm -- If I haven't seen further, it is by standing in the footprints of giants