Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
8b110df7
Commit
8b110df7
authored
Aug 14, 1998
by
sof
Browse files
[project @ 1998-08-14 11:15:07 by sof]
If possible, use new IO support for doing block IO
parent
384ab178
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/utils/FastString.lhs
View file @
8b110df7
...
...
@@ -59,9 +59,17 @@ import IOBase ( Handle__(..), IOError(..), IOErrorType(..),
#else
import PrelPack
import PrelST ( StateAndPtr#(..) )
import PrelHandle ( filePtr, readHandle, writeHandle )
import PrelHandle ( readHandle,
#if __GLASGOW_HASKELL__ < 303
filePtr, flushBuf,
#endif
writeHandle
)
import PrelIOBase ( Handle__(..), IOError(..), IOErrorType(..),
IOResult(..), IO(..),
#if __GLASGOW_HASKELL__ >= 303
Handle__Type(..),
#endif
constructError
)
#endif
...
...
@@ -463,6 +471,7 @@ Outputting @FastString@s is quick, just block copying the chunk (using
\begin{code}
hPutFS :: Handle -> FastString -> IO ()
#if __GLASGOW_HASKELL__ <= 302
hPutFS handle (FastString _ l# ba#) =
if l# ==# 0# then
return ()
...
...
@@ -517,6 +526,16 @@ hPutFS handle (CharStr a# l#) =
else
constructError "hPutFS" >>= \ err ->
fail err
#else
hPutFS handle (FastString _ l# ba#)
| l# ==# 0# = return ()
| otherwise = hPutBufBA handle (ByteArray bottom ba#) (I# l#)
where
bottom = error "hPutFS.ba"
hPutFS handle (CharStr a# l#)
| l# ==# 0# = return ()
| otherwise = hPutBuf handle (A# a#) (I# l#)
--ToDo: avoid silly code duplic.
#endif
\end{code}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment