Changing to use the new IO primitives.
Addr is no longer a synonym of Int.
#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,
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
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 ()
case rs of
Right r -> return r
Left e -> ioError e
-
--- TODO: Hugs/slurbFile
+-- TODO: Hugs/slurpFile
slurpFile = unimp "slurpFile"
\end{code}
#endif