
Adrian Hey writes:
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."
Can you give one concrete example of an "intended application of oneShot", so that we can either propose a concrete Haskell implementation of it, or agree that global variables really are necessary.
Any C library which requires an explicit initialisation call before anything in that library can be used (common enough IME). Accidental re-initialisation (e.g. by two independent modules/libraries) will destroy any state currently be used by the libraries existing "clients".
Great, thanks, that's just what I was hoping for - I now see the problem you're trying to address. --KW 8-)