[project @ 2000-07-06 16:31:45 by simonpj]
[ghc-hetmet.git] / ghc / compiler / utils / FastString.lhs
index 7560642..f0e7d9c 100644 (file)
@@ -86,17 +86,17 @@ import PrelIOBase   ( Handle__(..), IOError(..), IOErrorType(..),
 
 import PrimPacked
 import GlaExts
-import Addr            ( Addr(..) )
+import PrelAddr                ( Addr(..) )
 #if __GLASGOW_HASKELL__ < 407
 import MutableArray    ( MutableArray(..) )
 #else
 import PrelArr         ( STArray(..), newSTArray )
-import IOExts          ( hPutBuf, hPutBufBA )
+import IOExts          ( hPutBufFull, hPutBufBAFull )
 #endif
 
 -- ForeignObj is now exported abstractly.
 #if __GLASGOW_HASKELL__ >= 303
-import qualified PrelForeign as Foreign  ( ForeignObj(..) )
+import PrelForeign      ( ForeignObj(..) )
 #else
 import Foreign         ( ForeignObj(..) )
 #endif
@@ -331,7 +331,7 @@ mkFastSubStringFO# fo# start# len# =
     [] -> 
        -- no match, add it to table by copying out the
        -- the string into a ByteArray
-       case copySubStrFO (_ForeignObj fo#) (I# start#) (I# len#) of
+       case copySubStrFO (ForeignObj fo#) (I# start#) (I# len#) of
 #if __GLASGOW_HASKELL__ < 405
         (ByteArray _ barr#) ->  
 #else
@@ -345,7 +345,7 @@ mkFastSubStringFO# fo# start# len# =
        -- entry with same length and compare byte by byte.
        case bucket_match ls start# len# fo# of
         Nothing -> 
-           case copySubStrFO (_ForeignObj fo#) (I# start#) (I# len#) of
+           case copySubStrFO (ForeignObj fo#) (I# start#) (I# len#) of
 #if __GLASGOW_HASKELL__ < 405
             (ByteArray _ barr#) ->  
 #else
@@ -449,8 +449,8 @@ mkFastSubString :: Addr -> Int -> Int -> FastString
 mkFastSubString (A# a#) (I# start#) (I# len#) =
  mkFastString# (addrOffset# a# start#) len#
 
-mkFastSubStringFO :: _ForeignObj -> Int -> Int -> FastString
-mkFastSubStringFO (_ForeignObj fo#) (I# start#) (I# len#) =
+mkFastSubStringFO :: ForeignObj -> Int -> Int -> FastString
+mkFastSubStringFO (ForeignObj fo#) (I# start#) (I# len#) =
  mkFastSubStringFO# fo# start# len#
 \end{code}
 
@@ -639,7 +639,7 @@ hPutFS handle (FastString _ l# ba#)
   | otherwise  = hPutBufBA handle (ByteArray bot bot ba#) (I# l#)
 #else
   | otherwise  = do mba <- stToIO $ unsafeThawByteArray (ByteArray (bot::Int) bot ba#)
-                    hPutBufBA  handle mba (I# l#)
+                    hPutBufBAFull  handle mba (I# l#)
 #endif
  where
   bot = error "hPutFS.ba"
@@ -648,8 +648,11 @@ hPutFS handle (FastString _ l# ba#)
 
 hPutFS handle (CharStr a# l#)
   | l# ==# 0#  = return ()
+#if __GLASGOW_HASKELL__ < 407
   | otherwise  = hPutBuf handle (A# a#) (I# l#)
-
+#else
+  | otherwise  = hPutBufFull handle (A# a#) (I# l#)
+#endif
 
 #endif
 \end{code}