Commit 1b3b9664 authored by andy's avatar andy
Browse files

[project @ 1999-11-01 02:04:31 by andy]

Changing to use the new IO primitives.
Addr is no longer a synonym of Int.
parent 7568c81c
...@@ -738,12 +738,14 @@ readLn = do l <- getLine ...@@ -738,12 +738,14 @@ readLn = do l <- getLine
#else #else
\begin{code} \begin{code}
import Ix(Ix)
unimp :: String -> a unimp :: String -> a
unimp s = error ("function not implemented: " ++ s) unimp s = error ("function not implemented: " ++ s)
type FILE_STAR = Int type FILE_STAR = Addr
type Ptr = Int type Ptr = Addr
nULL = 0 :: Int nULL = nullAddr
data Handle data Handle
= Handle { name :: FilePath, = Handle { name :: FilePath,
...@@ -760,7 +762,7 @@ instance Eq Handle where ...@@ -760,7 +762,7 @@ instance Eq Handle where
h1 == h2 = file h1 == file h2 h1 == h2 = file h1 == file h2
instance Show Handle where instance Show Handle where
showsPrec _ h = showString ("<<handle " ++ name h ++ "=" ++ show (file h) ++ ">>") showsPrec _ h = showString ("<<handle " ++ name h ++ ">>")
data HandlePosn data HandlePosn
= HandlePosn = HandlePosn
...@@ -878,7 +880,7 @@ hPutStr h s ...@@ -878,7 +880,7 @@ hPutStr h s
write_all f [] write_all f []
= return () = return ()
write_all f (c:cs) write_all f (c:cs)
= nh_write f (primCharToInt c) >> = nh_write f c >>
write_all f cs write_all f cs
hPutChar :: Handle -> Char -> IO () hPutChar :: Handle -> Char -> IO ()
...@@ -946,8 +948,7 @@ bracket_ before after m = do ...@@ -946,8 +948,7 @@ bracket_ before after m = do
case rs of case rs of
Right r -> return r Right r -> return r
Left e -> ioError e Left e -> ioError e
-- TODO: Hugs/slurpFile
-- TODO: Hugs/slurbFile
slurpFile = unimp "slurpFile" slurpFile = unimp "slurpFile"
\end{code} \end{code}
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment