projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6abdb1c
)
Fix documentation for mkWeakIORef: argument is finalizer, not key or value
author
Dmitry Astapov
<dastapov@gmail.com>
Wed, 19 Jan 2011 10:14:45 +0000
(10:14 +0000)
committer
Dmitry Astapov
<dastapov@gmail.com>
Wed, 19 Jan 2011 10:14:45 +0000
(10:14 +0000)
Data/IORef.hs
patch
|
blob
|
history
diff --git
a/Data/IORef.hs
b/Data/IORef.hs
index
a6f29e7
..
6a27487
100644
(file)
--- a/
Data/IORef.hs
+++ b/
Data/IORef.hs
@@
-55,7
+55,8
@@
import NHC.IOExtras
#endif
#if defined(__GLASGOW_HASKELL__) && !defined(__PARALLEL_HASKELL__)
#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 #)
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 #)