[Haskell] Re: Global Variables and IO initializers

George Russell ger at informatik.uni-bremen.de
Wed Nov 24 06:12:27 EST 2004


Tomasz wrote:
 > Without unsafePerformIO Haskell gives me many guarantees for free.
 > With unsafePerformIO, they are no longer for free, I have to think, prove,
 > etc. When I mistakenly give a pure function interface to an unpure
 > "function", it can affect my program in most unexpected places.

I think with the functions implemented by my proposal and without unsafePerformIO
you can have all the guarantees, but still have global variables.  In particular
you can implement most of John Meacham's examples (the Random module), Data.Unique,
and Caching.


More information about the Haskell mailing list