Data.ByteString.Char8

The plain source file for module Data.ByteString.Char8 is not available.
module Data.ByteString.Char8
    (ByteString,pack,unpack,index,substr,singleton,length,hGetContents)
    where
import Prelude hiding (length)
import IO(Handle)
{-
newtype ByteString = Pack {unpack::String}
                     deriving (Eq,Ord)

pack = Pack
-}

data ByteString

foreign import pack :: String->ByteString
foreign import unpack :: ByteString->String
foreign import eq :: ByteString->ByteString->Bool
foreign import lte :: ByteString->ByteString->Bool
foreign import length :: ByteString->Int
foreign import index :: ByteString->Int->Char
foreign import substr :: ByteString->Int->Int->ByteString

instance Eq ByteString where (==) = eq
instance Ord ByteString where (<=) = lte


----------

singleton c = pack [c]

hGetContents :: Handle -> IO ByteString
hGetContents = error "ByteString.hGetContents not implemented"

Index

(HTML for this module was generated on 2010-10-23. About the conversion tool.)