[project @ 2004-04-20 09:18:46 by simonmar]
[ghc-base.git] / GHC / Ptr.lhs
index ab0e6e1..7f43745 100644 (file)
@@ -27,7 +27,7 @@ data Ptr a = Ptr Addr# deriving (Eq, Ord)
 -- of type @a@.
 --
 --  The type @a@ will normally be an instance of class
--- 'Storable' which provides the marshalling operations.
+-- 'Foreign.Storable.Storable' which provides the marshalling operations.
 
 
 -- |The constant 'nullPtr' contains a distinguished value of 'Ptr'
@@ -56,13 +56,10 @@ alignPtr addr@(Ptr a) (I# i)
 -- |Computes the offset required to get from the first to the second
 -- argument.  We have 
 --
--- > p2 == p1 \`'plusPtr'\` (p2 \`'minusPtr'\` p1)
+-- > p2 == p1 `plusPtr` (p2 `minusPtr` p1)
 minusPtr :: Ptr a -> Ptr b -> Int
 minusPtr (Ptr a1) (Ptr a2) = I# (minusAddr# a1 a2)
 
-instance CCallable   (Ptr a)
-instance CReturnable (Ptr a)
-
 ------------------------------------------------------------------------
 -- Function pointers for the default calling convention.
 
@@ -73,8 +70,8 @@ data FunPtr a = FunPtr Addr# deriving (Eq, Ord)
 -- dynamic@ should normally be declared to produce a
 -- 'FunPtr' of the correct type.  For example:
 --
--- > type Compare = 'Int' -> 'Int' -> 'Bool'
--- > foreign export dynamic mkCompare :: Compare -> 'IO' ('FunPtr' Compare)
+-- > type Compare = Int -> Int -> Bool
+-- > foreign export dynamic mkCompare :: Compare -> IO (FunPtr Compare)
 
 -- |The constant 'nullFunPtr' contains a
 -- distinguished value of 'Ptr' that is not
@@ -93,9 +90,5 @@ castFunPtrToPtr (FunPtr addr) = Ptr addr
 -- |Casts a 'Ptr' to a 'FunPtr'
 castPtrToFunPtr :: Ptr a -> FunPtr b
 castPtrToFunPtr (Ptr addr) = FunPtr addr
-
-instance CCallable   (FunPtr a)
-instance CReturnable (FunPtr a)
-
 \end{code}