
4 Dec
2006
4 Dec
'06
9 p.m.
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