[project @ 2002-05-09 13:16:29 by simonmar]
[ghc-base.git] / System / Mem / Weak.hs
index 09c095d..62495fc 100644 (file)
@@ -1,15 +1,13 @@
 -----------------------------------------------------------------------------
--- 
+-- |
 -- Module      :  System.Mem.Weak
 -- Copyright   :  (c) The University of Glasgow 2001
--- License     :  BSD-style (see the file libraries/core/LICENSE)
+-- License     :  BSD-style (see the file libraries/base/LICENSE)
 -- 
 -- Maintainer  :  libraries@haskell.org
 -- Stability   :  experimental
 -- Portability :  non-portable
 --
--- $Id: Weak.hs,v 1.1 2001/06/28 14:15:04 simonmar Exp $
---
 -- Weak references, weak pairs, weak pointers, and finalizers.
 --
 -----------------------------------------------------------------------------
@@ -30,14 +28,16 @@ module System.Mem.Weak (
 
 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
 
+#include "Dynamic.h"
+INSTANCE_TYPEABLE1(Weak,weakTc,"Weak")
+
 deRefWeak :: Weak v -> IO (Maybe v)
 deRefWeak (Weak w) = IO $ \s ->
    case deRefWeak# w s of
@@ -54,3 +54,4 @@ finalize (Weak w) = IO $ \s ->
        (# s1, 0#, _ #) -> (# s1, () #) -- already dead, or no finaliser
        (# s1, _,  f #) -> f s1
 #endif
+