import Control.Monad ( sequence_ )
import Foreign.Ptr
import Foreign.Storable
-import Data.Dynamic
+import Data.Typeable
import GHC.List ( null )
import GHC.Base
(# 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))
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.
--
-- 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.