Hi all, does anyone have any tips on how to insert debugging or logging statements through a program? Here are two possibilities:
1. Use some kind of logging monad. But then all your types become
more complicated and it seems you have to use lots of ->'s and
>>='s instead of ordinary function application. It seems this can
make the code much less elegant.
Also it seems that every time you want to add logging to a
function, you have to change its type, and then change the type of
all the functions that call it, etc. Should it really be this
complicated?
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.
It seems this must come up a lot when writing Haskell programs. What
do most pople do?
--
Ben Escoto
pgp00000.pgp
Description: PGP signature
_______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
