-- Shared global variables:

sharedGlobal :: a -> (Ptr (IORef a) -> IO (Ptr (IORef a))) -> IORef a
sharedGlobal a get_or_set = unsafePerformIO $
  newIORef a >>= flip sharedCAF get_or_set
sharedGlobal :: a -> (Ptr (IORef a) -> IO (Ptr (IORef a))) -> IORef a
sharedGlobal a get_or_set = unsafePerformIO $
  newIORef a >>= flip sharedCAF get_or_set
sharedGlobal a get_or_set = unsafePerformIO $
  newIORef a >>= flip sharedCAF get_or_set