Swap imports around to get GHC.ForeignPtr out of the base knot
authorIan Lynagh <igloo@earth.li>
Wed, 6 Aug 2008 12:13:13 +0000 (12:13 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 6 Aug 2008 12:13:13 +0000 (12:13 +0000)
Data/Typeable.hs
GHC/ForeignPtr.hs

index cad0b78..cf48c95 100644 (file)
@@ -104,7 +104,6 @@ import GHC.IOBase       ( IO, MVar, Handle, block )
 import GHC.ST           ( ST )
 import GHC.STRef        ( STRef )
 import GHC.Ptr          ( Ptr, FunPtr )
-import GHC.ForeignPtr   ( ForeignPtr )
 import GHC.Stable       ( StablePtr, newStablePtr, freeStablePtr,
                           deRefStablePtr, castStablePtrToPtr,
                           castPtrToStablePtr )
@@ -538,7 +537,6 @@ instance Typeable7 (,,,,,,) where
 
 INSTANCE_TYPEABLE1(Ptr,ptrTc,"Ptr")
 INSTANCE_TYPEABLE1(FunPtr,funPtrTc,"FunPtr")
-INSTANCE_TYPEABLE1(ForeignPtr,foreignPtrTc,"ForeignPtr")
 INSTANCE_TYPEABLE1(StablePtr,stablePtrTc,"StablePtr")
 INSTANCE_TYPEABLE1(IORef,iORefTc,"IORef")
 
index 64f763a..e043e09 100644 (file)
@@ -35,6 +35,7 @@ module GHC.ForeignPtr
 
 import Control.Monad    ( sequence_ )
 import Foreign.Storable
+import Data.Typeable
 
 import GHC.Show
 import GHC.List         ( null )
@@ -44,6 +45,8 @@ import GHC.STRef        ( STRef(..) )
 import GHC.Ptr          ( Ptr(..), FunPtr )
 import GHC.Err
 
+#include "Typeable.h"
+
 -- |The type 'ForeignPtr' represents references to objects that are
 -- maintained in a foreign language, i.e., that are not part of the
 -- data structures usually managed by the Haskell storage manager.
@@ -71,6 +74,8 @@ data ForeignPtr a = ForeignPtr Addr# ForeignPtrContents
         -- object, because that ensures that whatever the finalizer is
         -- attached to is kept alive.
 
+INSTANCE_TYPEABLE1(ForeignPtr,foreignPtrTc,"ForeignPtr")
+
 data ForeignPtrContents
   = PlainForeignPtr !(IORef [IO ()])
   | MallocPtr      (MutableByteArray# RealWorld) !(IORef [IO ()])