projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2004-04-20 09:18:46 by simonmar]
[ghc-base.git]
/
GHC
/
Ptr.lhs
diff --git
a/GHC/Ptr.lhs
b/GHC/Ptr.lhs
index
ab0e6e1
..
7f43745
100644
(file)
--- a/
GHC/Ptr.lhs
+++ b/
GHC/Ptr.lhs
@@
-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
-- 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'
-- |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
--
-- |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)
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.
------------------------------------------------------------------------
-- 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:
--
-- 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
-- |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
-- |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}
\end{code}