Skip to content

Commit b2eff78

Browse files
Bodigrimclyring
andauthored
Update Data/ByteString/Lazy.hs
Co-authored-by: Matthew Craven <[email protected]>
1 parent 357f09d commit b2eff78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Data/ByteString/Lazy.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,9 +1602,9 @@ illegalBufferSize handle fn sz =
16021602
-- File handles are closed on EOF if all the file is read, or through
16031603
-- garbage collection otherwise.
16041604
--
1605-
-- Do not use this function inside a 'Control.Exception.bracket' \/
1605+
-- Beware of using this function inside of 'Control.Exception.bracket' \/
16061606
-- 'System.IO.withFile' \/ 'System.IO.withBinaryFile':
1607-
-- lazy I/O will escape it causing 'Control.Exception.bracket' to close a handle prematurely:
1607+
-- lazy I/O can easily escape it causing 'Control.Exception.bracket' to close a handle prematurely:
16081608
--
16091609
-- >>> withBinaryFile "foo.txt" ReadMode BL.hGetContents >>= print
16101610
-- "*** Exception: foo.txt: hGetBufSome: illegal operation (handle is closed)

0 commit comments

Comments
 (0)