Global variables
David House
dmhouse at gmail.com
Thu Feb 1 11:51:39 EST 2007
On 01/02/07, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> there is common proposal that i support. example of its use:
>
> i :: IORef Int
> i <- newIORef 1
>
> with a semantics equivalent to current use of usafePerformIO+INLINE in GHC
I think that's too safe-looking. Anything that translates to something
involving unsafe* should be tagged with 'unsafe' somewhere as well.
Also, as unsafe* is still compiler specific, I think a pragma is
probably most appropriate:
{-# GLOBAL-MUTVAR #-}
i :: IORef Int
i = unsafePerformIO (newIORef 1)
--
-David House, dmhouse at gmail.com
More information about the Haskell-prime
mailing list