on master help sign in
Fix documentation for hGetChunk
24fd53eBryan O'Sullivan
Data/Text/IO.hs+7−1
@@ -107,7 +107,13 @@ catchError caller h Handle__{..} err
107 else T.singleton '\r'
107 else T.singleton '\r'
108 | otherwise = E.throwIO (augmentIOError err caller h)
108 | otherwise = E.throwIO (augmentIOError err caller h)
109
109
110−-- | Read a single chunk of strict text from a 'Handle'.
110+-- | /Experimental./ Read a single chunk of strict text from a
111+-- 'Handle'. The size of the chunk depends on the amount of input
112+-- currently buffered.
113+--
114+-- This function blocks only if there is no data available, and EOF
115+-- has not yet been reached. Once EOF is reached, this function
116+-- returns an empty string instead of throwing an exception.
111hGetChunk :: Handle -> IO Text
117hGetChunk :: Handle -> IO Text
112hGetChunk h = wantReadableHandle "hGetChunk" h readSingleChunk
118hGetChunk h = wantReadableHandle "hGetChunk" h readSingleChunk
113 where
119 where