Prime -> 2010
[haskell-report.git] / report / lib-hdrs / IO.hs
1 module IO (
2 Handle, HandlePosn,
3 IOMode(ReadMode,WriteMode,AppendMode,ReadWriteMode),
4 BufferMode(NoBuffering,LineBuffering,BlockBuffering),
5 SeekMode(AbsoluteSeek,RelativeSeek,SeekFromEnd),
6 stdin, stdout, stderr,
7 openFile, hClose, hFileSize, hIsEOF, isEOF,
8 hSetBuffering, hGetBuffering, hFlush,
9 hGetPosn, hSetPosn, hSeek,
10 hWaitForInput, hReady, hGetChar, hGetLine, hLookAhead,
11 hGetContents, hPutChar, hPutStr, hPutStrLn, hPrint,
12 hIsOpen, hIsClosed, hIsReadable, hIsWritable, hIsSeekable,
13 isAlreadyExistsError, isDoesNotExistError, isAlreadyInUseError,
14 isFullError, isEOFError,
15 isIllegalOperation, isPermissionError, isUserError,
16 ioeGetErrorString, ioeGetHandle, ioeGetFileName,
17 try, bracket, bracket_,
18
19 -- ...and what the Prelude exports
20 IO, FilePath, IOError, ioError, userError, catch, interact,
21 putChar, putStr, putStrLn, print, getChar, getLine, getContents,
22 readFile, writeFile, appendFile, readIO, readLn
23 ) where
24
25 import Ix(Ix)
26
27 data Handle = ... -- implementation-dependent
28 instance Eq Handle where ...
29 instance Show Handle where .. -- implementation-dependent
30
31 data HandlePosn = ... -- implementation-dependent
32 instance Eq HandlePosn where ...
33 instance Show HandlePosn where --- -- implementation-dependent
34
35
36 data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
37 deriving (Eq, Ord, Ix, Bounded, Enum, Read, Show)
38 data BufferMode = NoBuffering | LineBuffering
39 | BlockBuffering (Maybe Int)
40 deriving (Eq, Ord, Read, Show)
41 data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
42 deriving (Eq, Ord, Ix, Bounded, Enum, Read, Show)
43
44 stdin, stdout, stderr :: Handle
45
46 openFile :: FilePath -> IOMode -> IO Handle
47 hClose :: Handle -> IO ()