summaryrefslogtreecommitdiff
path: root/ghc/lib/std/IO.lhs
diff options
context:
space:
mode:
authorandy <unknown>1999-11-01 02:04:31 +0000
committerandy <unknown>1999-11-01 02:04:31 +0000
commit1b3b96644eb935b8c9fc6b4dbea58c4416daffc8 (patch)
tree41373e842940107793bdb33f28b54216af6d2c18 /ghc/lib/std/IO.lhs
parent7568c81c56dd8538f0cee6253bc893ddb44d9d7d (diff)
downloadhaskell-1b3b96644eb935b8c9fc6b4dbea58c4416daffc8.tar.gz
[project @ 1999-11-01 02:04:31 by andy]
Changing to use the new IO primitives. Addr is no longer a synonym of Int.
Diffstat (limited to 'ghc/lib/std/IO.lhs')
-rw-r--r--ghc/lib/std/IO.lhs15
1 files changed, 8 insertions, 7 deletions
diff --git a/ghc/lib/std/IO.lhs b/ghc/lib/std/IO.lhs
index ad656a5f8b..4bd0df114f 100644
--- a/ghc/lib/std/IO.lhs
+++ b/ghc/lib/std/IO.lhs
@@ -738,12 +738,14 @@ readLn = do l <- getLine
#else
\begin{code}
+import Ix(Ix)
+
unimp :: String -> a
unimp s = error ("function not implemented: " ++ s)
-type FILE_STAR = Int
-type Ptr = Int
-nULL = 0 :: Int
+type FILE_STAR = Addr
+type Ptr = Addr
+nULL = nullAddr
data Handle
= Handle { name :: FilePath,
@@ -760,7 +762,7 @@ instance Eq Handle where
h1 == h2 = file h1 == file h2
instance Show Handle where
- showsPrec _ h = showString ("<<handle " ++ name h ++ "=" ++ show (file h) ++ ">>")
+ showsPrec _ h = showString ("<<handle " ++ name h ++ ">>")
data HandlePosn
= HandlePosn
@@ -878,7 +880,7 @@ hPutStr h s
write_all f []
= return ()
write_all f (c:cs)
- = nh_write f (primCharToInt c) >>
+ = nh_write f c >>
write_all f cs
hPutChar :: Handle -> Char -> IO ()
@@ -946,8 +948,7 @@ bracket_ before after m = do
case rs of
Right r -> return r
Left e -> ioError e
-
--- TODO: Hugs/slurbFile
+-- TODO: Hugs/slurpFile
slurpFile = unimp "slurpFile"
\end{code}
#endif