Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
c6cd2da1
by Jappie Klooster at 2025-07-17T06:06:20-04:00
1 changed file:
Changes:
| ... | ... | @@ -425,6 +425,21 @@ getContents' = hGetContents' stdin |
| 425 | 425 | --
|
| 426 | 426 | -- This operation may fail with the same errors as 'getContents' and 'putStr'.
|
| 427 | 427 | --
|
| 428 | +-- If it doesn't produce output the buffering settings may not be
|
|
| 429 | +-- correct, use ^D (ctrl+D) to close stdin which forces
|
|
| 430 | +-- the buffer to be consumed.
|
|
| 431 | +--
|
|
| 432 | +-- You may wish to set the buffering style appropriate to your program's
|
|
| 433 | +-- needs before using this function, for example:
|
|
| 434 | +--
|
|
| 435 | +-- @
|
|
| 436 | +-- main :: IO ()
|
|
| 437 | +-- main = do
|
|
| 438 | +-- hSetBuffering stdin LineBuffering
|
|
| 439 | +-- hSetBuffering stdout NoBuffering
|
|
| 440 | +-- interact (concatMap (\str -> str ++ str) . L.lines)
|
|
| 441 | +-- @
|
|
| 442 | +--
|
|
| 428 | 443 | -- ==== __Examples__
|
| 429 | 444 | --
|
| 430 | 445 | -- >>> interact (\str -> str ++ str)
|