From 39c721869eb55206532179f926ec947ef12b1842 Mon Sep 17 00:00:00 2001 From: Dmitry Astapov Date: Wed, 19 Jan 2011 10:14:45 +0000 Subject: [PATCH] Fix documentation for mkWeakIORef: argument is finalizer, not key or value --- Data/IORef.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 #) -- 1.7.10.4