by pictureotf · 16y ago · 0 comments
The GP's example is not a _global_ variable, by the way. Global variables are not really available in Haskell, except if you use unsafePerformIO:
import System.IO.Unsafe
{-# NOINLINE global #-}
global :: IORef Int
global = unsafePerformIO $ newIORef 0It's nice to know what your software does without having to guess and pray. That is worth saying "runState foo 42" instead of just "foo".
Isn't that the point of this whole argument?