[Haskell] Re: Global Variables and IO initializers

Keean Schupke k.schupke at imperial.ac.uk
Sat Nov 6 08:07:05 EST 2004

Just been reading arround. According to ghc docs, the noinline
pragma is in the Haskell98 report. On that basis what is wrong
with using the following to initialise these top-level constants?

    {-# NOINLINE newref #-}
    newref :: IORef Int
    newref = unsafePerformIO $ newIORef 0


More information about the Haskell mailing list