I call a C function from a Haskell program. I am using unsafePerformIO
to use it outside a monad. 

Even though the C function does not have any side effect, I absolutely
don't want to evaluate it more than once for performance reasons. But my
impression is that it is evaluated several times.

1. Can I monitor somehow how often it is evaluated?
2. Can I ensure that the function is evaluated only once?

I am using ghc 6.4.1

I ma grateful for any hint!


Phone: +46 8 790 4124, Email: [EMAIL PROTECTED], Web: www.it.kth.se/~axel


Phone: +46 8 790 4124, Email: [EMAIL PROTECTED], Web: www.imit.kth.se/~axel
FFI mailing list

Reply via email to