----------------------------------------------------------------------------- -- References for the IO monad: -- -- This file contains (non-standard) hooks for an implementation of -- mutable variables, or references, in O'Hugs. These operations -- are only available if the version of Hugs that you are using was -- built with the IO_REFS flag set. -- -- Suitable for use with O'Hugs. ----------------------------------------------------------------------------- module IORef where -- type IORef a -- builtin type of IO references primitive newIORef :: a -> IO (IORef a) primitive readIORef :: IORef a -> IO a primitive writeIORef :: IORef a -> a -> IO () primitive eqIORef :: IORef a -> IORef a -> Bool instance Eq (IORef a) where (==) = eqIORef -----------------------------------------------------------------------------