|
| System.IO | | Portability | portable | | Stability | provisional | | Maintainer | libraries@haskell.org |
|
|
|
|
|
| Description |
| The standard IO library.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| data Handle |
|
|
| data HandlePosn |
|
|
| data IOMode |
| Constructors | | ReadMode | | | WriteMode | | | AppendMode | | | ReadWriteMode | |
| | Instances | |
|
|
| data BufferMode |
| Constructors | | NoBuffering | | | LineBuffering | | | BlockBuffering (Maybe Int) | |
| | Instances | |
|
|
| data SeekMode |
| Constructors | | AbsoluteSeek | | | RelativeSeek | | | SeekFromEnd | |
| | Instances | |
|
|
| stdin :: Handle |
|
| stdout :: Handle |
|
| stderr :: Handle |
|
| openFile :: FilePath -> IOMode -> IO Handle |
|
| hClose :: Handle -> IO () |
|
| hFileSize :: Handle -> IO Integer |
|
| hIsEOF :: Handle -> IO Bool |
|
| isEOF :: IO Bool |
|
| hSetBuffering :: Handle -> BufferMode -> IO () |
|
| hGetBuffering :: Handle -> IO BufferMode |
|
| hFlush :: Handle -> IO () |
|
| hGetPosn :: Handle -> IO HandlePosn |
|
| hSetPosn :: HandlePosn -> IO () |
|
| hSeek :: Handle -> SeekMode -> Integer -> IO () |
|
| hTell :: Handle -> IO Integer |
|
| hWaitForInput :: Handle -> Int -> IO Bool |
|
| hReady :: Handle -> IO Bool |
|
| hGetChar :: Handle -> IO Char |
|
| hGetLine :: Handle -> IO String |
|
| hLookAhead :: Handle -> IO Char |
|
| hGetContents :: Handle -> IO String |
|
| hPutChar :: Handle -> Char -> IO () |
|
| hPutStr :: Handle -> String -> IO () |
|
| hPutStrLn :: Handle -> String -> IO () |
|
| hPrint :: (Show a) => Handle -> a -> IO () |
|
| hIsOpen :: Handle -> IO Bool |
|
| hIsClosed :: Handle -> IO Bool |
|
| hIsReadable :: Handle -> IO Bool |
|
| hIsWritable :: Handle -> IO Bool |
|
| hIsSeekable :: Handle -> IO Bool |
|
| isAlreadyExistsError :: IOError -> Bool |
|
| isDoesNotExistError :: IOError -> Bool |
|
| isAlreadyInUseError :: IOError -> Bool |
|
| isFullError :: IOError -> Bool |
|
| isEOFError :: IOError -> Bool |
|
| isIllegalOperation :: IOError -> Bool |
|
| isPermissionError :: IOError -> Bool |
|
| isUserError :: IOError -> Bool |
|
| ioeGetErrorString :: IOError -> String |
|
| ioeGetHandle :: IOError -> Maybe Handle |
|
| ioeGetFileName :: IOError -> Maybe FilePath |
|
| try :: IO a -> IO (Either IOError a) |
| The construct try comp exposes IO errors which occur within a
computation, and which are not fully handled.
Other exceptions are not caught by this variant;
to catch all exceptions, use try from Control.Exception. |
|
| data IO a |
A value of type IO a is a computation which, when performed,
does some I/O before returning a value of type a. There is really only one way to "perform" an I/O action: bind it to
Main.main in your program. When your program is run, the I/O will
be performed. It isn't possible to perform I/O from an arbitrary
function, unless that function is itself in the IO monad and called
at some point, directly or indirectly, from Main.main. IO is a monad, so IO actions can be combined using either the do-notation
or the >> and >>= operations from the Monad class.
| | Instances | |
|
|
| type FilePath = String |
|
| type IOError = IOException |
| The Haskell 98 type for exceptions in the IO monad.
In Haskell 98, this is an opaque type. |
|
| ioError :: IOError -> IO a |
|
| userError :: String -> IOError |
|
| catch :: IO a -> (IOError -> IO a) -> IO a |
|
| interact :: (String -> String) -> IO () |
|
| putChar :: Char -> IO () |
|
| putStr :: String -> IO () |
|
| putStrLn :: String -> IO () |
|
| print :: (Show a) => a -> IO () |
|
| getChar :: IO Char |
|
| getLine :: IO String |
|
| getContents :: IO String |
|
| readFile :: FilePath -> IO String |
|
| writeFile :: FilePath -> String -> IO () |
|
| appendFile :: FilePath -> String -> IO () |
|
| readIO :: (Read a) => String -> IO a |
|
| readLn :: (Read a) => IO a |
|
| hPutBuf :: Handle -> Ptr a -> Int -> IO () |
|
| hGetBuf :: Handle -> Ptr a -> Int -> IO Int |
|
| fixIO :: (a -> IO a) -> IO a |
|
| hSetEcho :: Handle -> Bool -> IO () |
| Set the echoing status of a handle connected to a terminal (GHC only). |
|
| hGetEcho :: Handle -> IO Bool |
| Get the echoing status of a handle connected to a terminal (GHC only). |
|
| hIsTerminalDevice :: Handle -> IO Bool |
| Is the handle connected to a terminal? (GHC only) |
|
| Produced by Haddock version 0.4 |