[project @ 1998-02-02 16:47:53 by simonm]
[ghc-hetmet.git] / ghc / lib / glaExts / ByteArray.lhs
1 %
2 % (c) The AQUA Project, Glasgow University, 1994-1997
3 %
4 \section[ByteArray]{The @ByteArray@ interface}
5
6 Immutable, read-only chunks of bytes, the @ByteArray@ collects
7 together the definitions in @ArrBase@ and exports them as one.
8
9 \begin{code}
10 module ByteArray
11        (
12         ByteArray(..),  -- not abstract, for now.
13         Ix,
14
15         --Indexing of ordinary @Arrays@ is standard Haskell and isn't defined here.
16         indexCharArray,     --:: Ix ix => ByteArray ix -> ix -> Char 
17         indexIntArray,      --:: Ix ix => ByteArray ix -> ix -> Int
18         indexAddrArray,     --:: Ix ix => ByteArray ix -> ix -> Addr
19         indexFloatArray,    --:: Ix ix => ByteArray ix -> ix -> Float
20         indexDoubleArray,   --:: Ix ix => ByteArray ix -> ix -> Double
21         
22         --Indexing off @Addrs@ is similar, and therefore given here.
23         indexCharOffAddr,   --:: Addr -> Int -> Char
24         indexIntOffAddr,    --:: Addr -> Int -> Int
25         indexAddrOffAddr,   --:: Addr -> Int -> Addr
26         indexFloatOffAddr,  --:: Addr -> Int -> Float
27         indexDoubleOffAddr, --:: Addr -> Int -> Double
28
29         Addr,
30         Word
31
32        ) where
33
34 import ArrBase
35 import Ix
36 import Foreign (Word)
37 import Addr
38
39 \end{code}
40