[Haskell-cafe] Re: [Haskell] Re: Global Variables and =?utf-8?q?IO initializers?=

Keean Schupke k.schupke at imperial.ac.uk
Mon Nov 8 16:53:09 EST 2004

Yes I didn't read your specification accurately... However I would argue
such a constraint on the problem domain is artificial as operating 
systems exist.
At the end of the day it is the job of the OS to manage such one-shot 
inits, not application code. (As the OS is the only thing that can 
manage resources
accross multiple programs)...

What did you think of the code example given where the one-shot nature is
provided by a 'C' wrapper around the FFI function. I think this is the best


Adrian Hey wrote:

>On Monday 08 Nov 2004 6:48 pm, Keean Schupke wrote:
>>Adrian Hey wrote:
>>>The problem is simple enough to restate for anyone who's interested.
>>>"Provide a simple reliable mechanism to ensure that in a given
>>>program run one particular top level IO operation cannot be executed
>>>more than once."
>>No language can guarantee this -  all I have to do is run 2 copies of
>>the executable at once... or wven sequentially!
>Read what I wrote :-)
>Adrian Hey
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org

More information about the Haskell-Cafe mailing list