[commit: packages/bytestring] master: Add documentation for Lazy hPut (ff9ea20)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:31:09 UTC 2017


Repository : ssh://git@git.haskell.org/bytestring

On branch  : master
Link       : http://git.haskell.org/packages/bytestring.git/commitdiff/ff9ea20972b82df46f5e0c49960a9c2d3c3f9282

>---------------------------------------------------------------

commit ff9ea20972b82df46f5e0c49960a9c2d3c3f9282
Author: Nicolas Mattia <nicolas at nmattia.com>
Date:   Sun Jun 12 21:30:35 2016 +0100

    Add documentation for Lazy hPut


>---------------------------------------------------------------

ff9ea20972b82df46f5e0c49960a9c2d3c3f9282
 Data/ByteString/Lazy.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Data/ByteString/Lazy.hs b/Data/ByteString/Lazy.hs
index 01d4c1c..9cf3ac5 100644
--- a/Data/ByteString/Lazy.hs
+++ b/Data/ByteString/Lazy.hs
@@ -1261,7 +1261,9 @@ appendFile f txt = bracket (openBinaryFile f AppendMode) hClose
 getContents :: IO ByteString
 getContents = hGetContents stdin
 
--- | Outputs a 'ByteString' to the specified 'Handle'.
+-- | Outputs a 'ByteString' to the specified 'Handle'. The chunks will be
+-- written one at a time. Other threads might write to the 'Handle' between the
+-- writes, and hence 'hPut' alone might not be suitable for concurrent writes.
 --
 hPut :: Handle -> ByteString -> IO ()
 hPut h cs = foldrChunks (\c rest -> S.hPut h c >> rest) (return ()) cs



More information about the ghc-commits mailing list