[Haskell-cafe] Is unsafePerformIO safe here?
newhoggy at gmail.com
Sun Dec 7 19:28:56 EST 2008
Is the following safe?
moo :: TVar Int
moo = unsafePerformIO $ newTVarIO 1
I'm interested in writing a stateful application, and I wanted to start with
writing some IO functions that did stuff on some state and then test them
over long periods of time in GHCi.
I was worried I might be depending on some guarantees that aren't actually
there, like moo being discarded and recreated inbetween invocations of
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe