The Death of Finalizers
Simon Marlow
simonmar at microsoft.com
Tue Oct 22 07:56:52 EDT 2002
> > It has a different type:
> >
> > atomicModifyIORef :: IORef a -> (a -> (a,b)) -> IO b
> > modifyIORef :: IORef a -> (a -> a) -> IO ()
>
> It would break backwards compatability, but
>
> modifyIORef_ :: IORef a -> (a -> IO a) -> IO ()
> modifyIORef :: IORef a -> (a -> IO (a, b)) -> IO b
>
> (both specified atomic) would be consistent with the MVar names.
Did you really mean those types, and not the types I quoted? That
implies unsafeInterleaveIO if they have to be atomic.
Cheers,
Simon
More information about the FFI
mailing list