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:
d826359
)
[project @ 2001-09-13 11:36:52 by simonmar]
author
simonmar
<unknown>
Thu, 13 Sep 2001 11:36:52 +0000
(11:36 +0000)
committer
simonmar
<unknown>
Thu, 13 Sep 2001 11:36:52 +0000
(11:36 +0000)
make this compile
System/Mem/Weak.hs
patch
|
blob
|
history
diff --git
a/System/Mem/Weak.hs
b/System/Mem/Weak.hs
index
09c095d
..
6a092e0
100644
(file)
--- a/
System/Mem/Weak.hs
+++ b/
System/Mem/Weak.hs
@@
-8,7
+8,7
@@
-- Stability : experimental
-- Portability : non-portable
--
-- Stability : experimental
-- Portability : non-portable
--
--- $Id: Weak.hs,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+-- $Id: Weak.hs,v 1.2 2001/09/13 11:36:52 simonmar Exp $
--
-- Weak references, weak pairs, weak pointers, and finalizers.
--
--
-- Weak references, weak pairs, weak pointers, and finalizers.
--
@@
-30,14
+30,16
@@
module System.Mem.Weak (
import Prelude
import Prelude
-#include "Dynamic.h"
-INSTANCE_TYPEABLE0(Weak,weakTc,"Weak")
+import Data.Dynamic
#ifdef __GLASGOW_HASKELL__
import GHC.Base
import GHC.IOBase
import GHC.Weak
#ifdef __GLASGOW_HASKELL__
import GHC.Base
import GHC.IOBase
import GHC.Weak
+#include "Dynamic.h"
+INSTANCE_TYPEABLE1(Weak,weakTc,"Weak")
+
deRefWeak :: Weak v -> IO (Maybe v)
deRefWeak (Weak w) = IO $ \s ->
case deRefWeak# w s of
deRefWeak :: Weak v -> IO (Maybe v)
deRefWeak (Weak w) = IO $ \s ->
case deRefWeak# w s of
@@
-54,3
+56,4
@@
finalize (Weak w) = IO $ \s ->
(# s1, 0#, _ #) -> (# s1, () #) -- already dead, or no finaliser
(# s1, _, f #) -> f s1
#endif
(# s1, 0#, _ #) -> (# s1, () #) -- already dead, or no finaliser
(# s1, _, f #) -> f s1
#endif
+