- -- * IORefs
- IORef, -- abstract, instance of: Eq, Typeable
- newIORef, -- :: a -> IO (IORef a)
- readIORef, -- :: IORef a -> IO a
- writeIORef, -- :: IORef a -> a -> IO ()
- modifyIORef, -- :: IORef a -> (a -> a) -> IO ()
- atomicModifyIORef, -- :: IORef a -> (a -> (a,b)) -> IO b
+ -- * IORefs
+ IORef, -- abstract, instance of: Eq, Typeable
+ newIORef, -- :: a -> IO (IORef a)
+ readIORef, -- :: IORef a -> IO a
+ writeIORef, -- :: IORef a -> a -> IO ()
+ modifyIORef, -- :: IORef a -> (a -> a) -> IO ()
+ atomicModifyIORef, -- :: IORef a -> (a -> (a,b)) -> IO b
mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))
mkWeakIORef r@(IORef (STRef r#)) f = IO $ \s ->
case mkWeak# r# r f s of (# s1, w #) -> (# s1, Weak w #)
mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))
mkWeakIORef r@(IORef (STRef r#)) f = IO $ \s ->
case mkWeak# r# r f s of (# s1, w #) -> (# s1, Weak w #)
--
-- Extending the atomicity to multiple 'IORef's is problematic, so it
-- is recommended that if you need to do anything more complicated
--
-- Extending the atomicity to multiple 'IORef's is problematic, so it
-- is recommended that if you need to do anything more complicated
--
atomicModifyIORef :: IORef a -> (a -> (a,b)) -> IO b
#if defined(__GLASGOW_HASKELL__)
--
atomicModifyIORef :: IORef a -> (a -> (a,b)) -> IO b
#if defined(__GLASGOW_HASKELL__)