[Haskell] Re: Global Variables and IO initializers

David Sabel sabel at ki.informatik.uni-frankfurt.de
Sat Nov 6 08:57:05 EST 2004

Keean Schupke wrote:

> David Sabel wrote:
>> The main reason is: Nobody asks for it.
> Actually I think Simon Marlow has talked in the past about wanting
> to make GHC only do safe optimisations on unsafePerformIO.
>> I conjecture, a problem is:
>> if you use FUNDIO as a semantics for Haskell, you have to give up
>> referential transparency in the strong sense. FUNDIO-programs are
>> only referential transparent with respect to the defined contextual 
>> equivalence.
>>   David
> Surely all programs are only referentialy transparent with regards to 
> the defined contextual equivalence? (just there is only one notion of 
> equivalence used so far)... What would the problem be with intoducing 
> other notions of equivalence to cope with things like unique naming... 

Perhaps something like this is possible, I don't know.

> After all you would only change the definition of equality for 
> unsafePerformIO and not for any other function.

There's a problem: Other functions can call functions which make use of 
unsafePerformIO. Maybe a dependency
analysis could a solution to split the parts of the program into one 
part which is 'unsafe' and needs a special treatment and the other 
'pure' part.


>    Keean.
> _______________________________________________
> Haskell mailing list
> Haskell at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell

More information about the Haskell mailing list