[Haskell-cafe] Performance counters

Andrew Coppin andrewcoppin at btinternet.com
Mon May 4 16:28:13 EDT 2009

OK, so I'm pretty sure I'm not the first person to run into this...

I've got a fairly large, complex program. It seems to work fine. But now 
I want to add some counters to measure various things.

Trouble is, to do that, I'd have to "infect" the entire program with 
boilerplate code to propogate these counters. At best I could wrap it up 
in a monad, but it's still annoying to have to make 90% of the code in 
the program monadic just to carry these performance counters around.

Does anybody know of a better solution? I could use the dreaded 
unsafePerformIO to prod some IORefs, but now you have to start 
sprinkling NOINLINE pragmas around and hope you know what you're 
doing... Scary! o_O

More information about the Haskell-Cafe mailing list