diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-12-14 01:06:05 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-12-14 01:06:05 +0000 |
commit | 80a3a15636ee7d3a951b8f257ccd1de9d78e2227 (patch) | |
tree | d670d02c092796b5af865beb9af1e51d255693fa /compiler/utils/FastString.lhs | |
parent | 3c171430d46c26bb733ee627d9a9a66951d22c74 (diff) | |
download | haskell-80a3a15636ee7d3a951b8f257ccd1de9d78e2227.tar.gz |
Remove a couple more FastBytes functions
Diffstat (limited to 'compiler/utils/FastString.lhs')
-rw-r--r-- | compiler/utils/FastString.lhs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs index 3ef92a46a1..faec29261b 100644 --- a/compiler/utils/FastString.lhs +++ b/compiler/utils/FastString.lhs @@ -33,7 +33,7 @@ module FastString fastStringToFastBytes, fastZStringToByteString, unsafeMkFastBytesString, - hashFB, + hashByteString, -- * FastZString FastZString, @@ -162,14 +162,11 @@ pokeCAString ptr str = in go str 0 -hashFB :: FastBytes -> Int -hashFB bs +hashByteString :: ByteString -> Int +hashByteString bs = inlinePerformIO $ BS.unsafeUseAsCStringLen bs $ \(ptr, len) -> return $ hashStr (castPtr ptr) len -hPutFB :: Handle -> FastBytes -> IO () -hPutFB = BS.hPut - -- ----------------------------------------------------------------------------- newtype FastZString = FastZString ByteString @@ -515,7 +512,7 @@ getFastStringTable = do -- |Outputs a 'FastString' with /no decoding at all/, that is, you -- get the actual bytes in the 'FastString' written to the 'Handle'. hPutFS :: Handle -> FastString -> IO () -hPutFS handle fs = hPutFB handle $ fastStringToFastBytes fs +hPutFS handle fs = BS.hPut handle $ fastStringToFastBytes fs -- ToDo: we'll probably want an hPutFSLocal, or something, to output -- in the current locale's encoding (for error messages and suchlike). |