[Haskell] Re: Global Variables and IO initializers

Benjamin Franksen benjamin.franksen at bessy.de
Thu Nov 4 13:15:25 EST 2004


On Thursday 04 November 2004 18:54, George Russell wrote:
> John Peterson wrote (snipped):
>  > The implementer of these functions has to guarantee that the
>  > actions do not destroy the commutativity of the CIO monad.
>
> Sorry, but several of my variable initialisation actions involve
> things like starting up child processes or rapid exits from the program
> if unsuccessful, which certainly cannot be guaranteed to be
> commutative.
>
> I still think the proposal I made to this list in June
>     http://www.haskell.org//pipermail/haskell/2004-June/014104.html
> is sound.  It requires nothing other than a new library, which is
> trivial to implement using the existing unsafePerformIO.  It is
> safe.  I don't think it's especially clunky.  Essentially the
> only serious limitation is that you can only access a bit of
> initialised state from an IO action, but in my experience at least
> this is not a serious issue.

The idea looks good to me. Do you have a prototype implementation?

Ben


More information about the Haskell mailing list