
31 Jan
2003
31 Jan
'03
2:19 p.m.
On Fri, 31 Jan 2003 07:47:43 +0000
Glynn Clements
The usual fudge is:
import IORef import IOExts
globalVar :: IORef Int globalVar = unsafePerformIO $ newIORef 0
I see in the documentation of unsafePerformIO that no one makes guarantees about the order in wich unsafePerformIO arguments are performed (especially they don't have to be executed BEFORE main), so this trick should not be adviced as a general practice; it should be pointed out that it works in GHC but could not work in other compilers. Vincenzo -- Fedeli alla linea, anche quando non c'è Quando l'imperatore è malato, quando muore,o è dubbioso, o è perplesso. Fedeli alla linea la linea non c'è. [CCCP]