Copyright | (c) Don Stewart 2007 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | dons@galois.com |
Stability | stable |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
System.IO.Strict
Description
The standard IO input functions using strict IO.
Synopsis
- hGetContents :: Handle -> IO String
- getContents :: IO String
- readFile :: FilePath -> IO String
- interact :: (String -> String) -> IO ()
Strict Handle IO
hGetContents :: Handle -> IO String Source #
Computation hGetContents
hdl
returns the list of characters
corresponding to the unread portion of the channel or file managed
by hdl
, which is immediate closed.
Items are read strictly from the input Handle.
This operation may fail with:
isEOFError
if the end of file has been reached.
Strict String IO wrappers
getContents :: IO String Source #
The getContents
operation returns all user input as a single string,
which is read stirctly (same as hGetContents
stdin
).
readFile :: FilePath -> IO String Source #
The readFile
function reads a file and
returns the contents of the file as a string.
The file is read strictly, as with getContents
.