RE: [Haskell-cafe] Top-level TVars

On 14 December 2005 09:57, Tomasz Zielonka wrote:
On Wed, Dec 14, 2005 at 09:51:16AM -0000, Simon Marlow wrote:
Here is an example how you can initialize a top-level STM variable. http://www.uncurry.com/repos/TimeVar/TimeVar.hs It just forks a new thread inside unsafePerformIO, it runs "atomically" in it and passes the result through ordinary MVar.
A cheaper way is just to seq the top-level TVar at the beginning of Main.main.
Yes, I tried that approach. However, imagine telling users of your library to do that in every program (withSocketsDo comes to mind).
Well sure, but it's only a temporary problem. And you also have to tell them to use {-# NOINLINE #-} and -fno-cse :-) Cheers, Simon

On Wed, Dec 14, 2005 at 10:03:42AM -0000, Simon Marlow wrote:
Well sure, but it's only a temporary problem. And you also have to tell them to use {-# NOINLINE #-} and -fno-cse :-)
-fno-cse is also neccesary? Oops, I didn't know that. Can I simply place it in {-# OPTIONS -fno-cse #-} ? Best regards Tomasz -- I am searching for a programmer who is good at least in some of [Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland

I'm a bit lost in the discussion. Why do I need -fno-cse and how do I seq at the top-level? On Dec 14, 2005, at 10:05 AM, Tomasz Zielonka wrote:
On Wed, Dec 14, 2005 at 10:03:42AM -0000, Simon Marlow wrote:
Well sure, but it's only a temporary problem. And you also have to tell them to use {-# NOINLINE #-} and -fno-cse :-)
-fno-cse is also neccesary? Oops, I didn't know that. Can I simply place it in {-# OPTIONS -fno-cse #-} ?
participants (3)
-
Joel Reymont
-
Simon Marlow
-
Tomasz Zielonka