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