+{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : System.Mem.Weak
-- $precise
) where
-import Prelude
-
-import Data.Dynamic
-
#ifdef __HUGS__
import Hugs.Weak
+import Prelude
#endif
#ifdef __GLASGOW_HASKELL__
finalizer to run earlier than you intended. The same motivation
justifies the existence of
'Control.Concurrent.MVar.addMVarFinalizer' and
- 'Data.IORef.mkWeakIORef' (the non-unformity is accidental).
+ 'Data.IORef.mkWeakIORef' (the non-uniformity is accidental).
-}
addFinalizer :: key -> IO () -> IO ()
addFinalizer key finalizer = do
- mkWeakPtr key (Just finalizer) -- throw it away
+ _ <- mkWeakPtr key (Just finalizer) -- throw it away
return ()
-- | A specialised version of 'mkWeak' where the value is actually a pair
mkWeakPair :: k -> v -> Maybe (IO ()) -> IO (Weak (k,v))
mkWeakPair key val finalizer = mkWeak key (key,val) finalizer
-#include "Typeable.h"
-INSTANCE_TYPEABLE1(Weak,weakTc,"Weak")
{- $precise