[Haskell] Re: Global Variables and IO initializers

Keean Schupke k.schupke at imperial.ac.uk
Mon Nov 8 05:58:02 EST 2004


>> Note that 2-rank type of runSTInit doesn't allow to
>> execute regular IO actions. Even that (ST s a) allows
>> actions like readRef and writeRef. This allows to
>> initialise local references but doesn't allow to
>> access other toplevel reverences since they are bound
>> to RealWorld state.
>>  
>
Thinking about this a bit more - isnt the real problem that the
IO monad should infact be a monad-transformer layered ontop
of the ST monad. That way ST actions could automatically be
lifted to the IO monad using the normal mechanisms provided
with monad-transformers.

    Keean.



More information about the Haskell mailing list