From: Dmitry Astapov Date: Wed, 19 Jan 2011 10:14:45 +0000 (+0000) Subject: Fix documentation for mkWeakIORef: argument is finalizer, not key or value X-Git-Url: http://git.megacz.com/?p=ghc-base.git;a=commitdiff_plain;h=39c721869eb55206532179f926ec947ef12b1842 Fix documentation for mkWeakIORef: argument is finalizer, not key or value --- diff --git a/Data/IORef.hs b/Data/IORef.hs index a6f29e7..6a27487 100644 --- a/Data/IORef.hs +++ b/Data/IORef.hs @@ -55,7 +55,8 @@ import NHC.IOExtras #endif #if defined(__GLASGOW_HASKELL__) && !defined(__PARALLEL_HASKELL__) --- |Make a 'Weak' pointer to an 'IORef' +-- |Make a 'Weak' pointer to an 'IORef', using the second argument as a finalizer +-- to run when 'IORef' is garbage-collected 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 #)