[project @ 2003-08-31 18:41:28 by ross]
[ghc-base.git] / GHC / ForeignPtr.hs
index 430d3ad..f67e67f 100644 (file)
@@ -31,7 +31,7 @@ module GHC.ForeignPtr
 import Control.Monad   ( sequence_ )
 import Foreign.Ptr
 import Foreign.Storable
-import Data.Dynamic
+import Data.Typeable
 
 import GHC.List        ( null )
 import GHC.Base
@@ -127,11 +127,11 @@ mallocForeignPtrBytes (I# size) = do
        (# s, MallocPtr mbarr# r #)
      }
 
-addForeignPtrFinalizer :: ForeignPtr a -> FinalizerPtr a -> IO ()
+addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO ()
 -- ^This function adds a finaliser to the given foreign object.  The
 -- finalizer will run /before/ all other finalizers for the same
 -- object which have already been registered.
-addForeignPtrFinalizer fptr finalizer = 
+addForeignPtrFinalizer finalizer fptr = 
   addForeignPtrConcFinalizer fptr 
        (mkFinalizer finalizer (unsafeForeignPtrToPtr fptr))
 
@@ -183,7 +183,7 @@ newForeignPtr_ (Ptr obj) =  do
 touchForeignPtr :: ForeignPtr a -> IO ()
 -- ^This function ensures that the foreign object in
 -- question is alive at the given place in the sequence of IO
--- actions. In particular 'withForeignPtr'
+-- actions. In particular 'Foreign.ForeignPtr.withForeignPtr'
 -- does a 'touchForeignPtr' after it
 -- executes the user action.
 -- 
@@ -215,7 +215,7 @@ unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a
 -- has another usage occurrence.
 --
 -- To avoid subtle coding errors, hand written marshalling code
--- should preferably use 'withForeignPtr' rather
+-- should preferably use 'Foreign.ForeignPtr.withForeignPtr' rather
 -- than combinations of 'unsafeForeignPtrToPtr' and
 -- 'touchForeignPtr'.  However, the later routines
 -- are occasionally preferred in tool generated marshalling code.