Commit 90cd8bd5 authored by sof's avatar sof
Browse files

[project @ 1999-01-25 14:02:03 by sof]

Added indexStablePtrArray (moved over from MutableArray)
parent 0cca1cdc
......@@ -13,16 +13,26 @@ module ByteArray
Ix,
--Indexing of ordinary @Arrays@ is standard Haskell and isn't defined here.
indexCharArray, -- :: Ix ix => ByteArray ix -> ix -> Char
indexIntArray, -- :: Ix ix => ByteArray ix -> ix -> Int
indexWordArray, -- :: Ix ix => ByteArray ix -> ix -> Word
indexAddrArray, -- :: Ix ix => ByteArray ix -> ix -> Addr
indexFloatArray, -- :: Ix ix => ByteArray ix -> ix -> Float
indexDoubleArray, -- :: Ix ix => ByteArray ix -> ix -> Double
indexCharArray, -- :: Ix ix => ByteArray ix -> ix -> Char
indexIntArray, -- :: Ix ix => ByteArray ix -> ix -> Int
indexWordArray, -- :: Ix ix => ByteArray ix -> ix -> Word
indexAddrArray, -- :: Ix ix => ByteArray ix -> ix -> Addr
indexFloatArray, -- :: Ix ix => ByteArray ix -> ix -> Float
indexDoubleArray, -- :: Ix ix => ByteArray ix -> ix -> Double
indexStablePtrArray -- :: Ix ix => ByteArray ix -> ix -> (StablePtr a)
) where
import PrelArr
import PrelBase
import PrelForeign
import Ix
\end{code}
\begin{code}
indexStablePtrArray :: Ix ix => ByteArray ix -> ix -> (StablePtr a)
indexStablePtrArray (ByteArray ixs barr#) n
= case (index ixs n) of { I# n# ->
case indexStablePtrArray# barr# n# of { r# ->
(StablePtr r#)}}
\end{code}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment