Bernie Pope wrote:
> If you want a global variable then you can use something like:
> 
>     import System.IO.Unsafe (unsafePerformIO)
> 
>     global = unsafePerformIO (newIORef [])
> 
> But this is often regarded as bad programming style (depends who you
> talk to). 

Besides, isn't this example /really/ unsafe? I thought, at least the IORef
has to be monomorphic or else type safety is lost?

Cheers
Ben

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to