On Fri, 31 Jan 2003 07:47:43 +0000
Glynn Clements <[EMAIL PROTECTED]> wrote:

>  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]

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to