Use explicit language extensions & remove extension fields from base.cabal
[ghc-base.git] / System / Mem / Weak.hs
index 1caf672..21411e5 100644 (file)
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Mem.Weak
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Mem.Weak
@@ -67,12 +69,9 @@ module System.Mem.Weak (
        -- $precise
    ) where
 
        -- $precise
    ) where
 
-import Prelude
-
-import Data.Dynamic
-
 #ifdef __HUGS__
 import Hugs.Weak
 #ifdef __HUGS__
 import Hugs.Weak
+import Prelude
 #endif
 
 #ifdef __GLASGOW_HASKELL__
 #endif
 
 #ifdef __GLASGOW_HASKELL__
@@ -102,11 +101,11 @@ mkWeakPtr key finalizer = mkWeak key key finalizer
   finalizer to run earlier than you intended.  The same motivation
   justifies the existence of
   'Control.Concurrent.MVar.addMVarFinalizer' and
   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
 -}
 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
    return ()
 
 -- | A specialised version of 'mkWeak' where the value is actually a pair
@@ -119,8 +118,6 @@ addFinalizer key finalizer = do
 mkWeakPair :: k -> v -> Maybe (IO ()) -> IO (Weak (k,v))
 mkWeakPair key val finalizer = mkWeak key (key,val) finalizer
 
 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
 
 
 {- $precise