Force single evaluation?

"Axel Jantsch" <[email protected]> Mon, 18 Dec 2006 17:09:45 +0100
Newsgroups gmane.comp.lang.haskell.ffi
Organization Royal Institute of Technology
Message-ID <[email protected]>
Hello,

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!

Regards,
Axel

-- 
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