How to best add logging/debugging code?
Iavor S. Diatchki
diatchki at cse.ogi.edu
Tue Nov 18 09:23:58 EST 2003
hello,
Ben Escoto wrote:
>Maybe eventually I will see a need for mapWriter. As a passing
>thought, I wonder how many programmers can read the mapWriterT
>documentation:
>
>mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b
>
>and start pounding the code out? Anyway, once I get this all sorted
>out, I figure my program will have really nice logging, better than
>fprintf(stderr, ...) even.
>
>
you should not use mapWriterT, usually you can get the same behaviour
in a different way
(i think it should not be exported by the module). by the way once you
learn how the tranformers work,
you'll be able to guess what that does from its type. however i think
it is nice if you can use the transformers
witout knowing how they are implemented. if you have access to cvs you
might want to look at
the revamped monad transformer library in the haskell cvs
(fptools/libraries/monads).
it is more docuemnted then the current one, but otherwise it is very
similar.
bye
iavor
--
==================================================
| Iavor S. Diatchki, Ph.D. student |
| Department of Computer Science and Engineering |
| School of OGI at OHSU |
| http://www.cse.ogi.edu/~diatchki |
==================================================
More information about the Haskell
mailing list