[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / lib / prelude / PreludeIO.lhs
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1994
3 %
4 \section[PrelIO]{Top Level I/O}
5
6 This module collects and exports the more primitive Prelude modules. 
7
8 \begin{code}
9
10 module PreludeIO (
11     (>>),
12     (>>=),
13     accumulate,
14     appendFile13,
15     either,
16     fail,
17     failWith,
18     getChar,
19     hClose,
20     hFileSize,
21     hFlush,
22     hGetChar,
23     hGetContents,
24     hGetPosn,
25     hIsBlockBuffered,
26     hIsClosed,
27     hIsEOF,
28     hIsLineBuffered,
29     hIsNotBuffered,
30     hIsOpen,
31     hIsReadable,
32     hIsSeekable,
33     hIsWritable,
34     hLookAhead,
35     hPutChar,
36     hPutStr,
37     hPutText,
38     hReady,
39     hSeek,
40     hSetBuffering,
41     hSetPosn,
42     handle,
43     interact13,
44     isEOF,
45     openFile,
46     putChar,
47     putStr,
48     putText,
49     print13,
50     readFile13,
51     return,
52     sequence,
53     stderr13,
54     stdin13,
55     stdout13,
56     try,
57     writeFile13,
58     IOError13(..),
59     Either(..),
60     BufferMode(..),
61     IOMode(..),
62     SeekMode(..),
63     Maybe(..),
64     FilePath(..),
65     Handle(..),
66     HandlePosn(..),
67     IO(..),
68     _Handle,
69     _MVar
70  ) where
71
72 import Cls
73 import Core
74 import IChar
75 import IInt
76 import IList
77 import List             ( (++) )
78 import PS
79 import Prel             ( (.) )
80 import Text
81
82 import PreludeGlaST
83 import PreludePrimIO    ( _MVar )
84 import PreludeIOError
85 import PreludeMonadicIO
86 import PreludeStdIO
87 import PreludeReadTextIO
88 import PreludeWriteTextIO
89
90 \end{code}
91
92 The interact computation supports classical Landin-stream character
93 I/O, as in Haskell 1.2.
94
95 \begin{code}
96
97 interact13 :: (String -> String) -> IO ()
98 interact13 f = hGetContents stdin13 >>= (putStr . f)
99
100 \end{code}