X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FIO.hs;h=1226fcc50ea16a3866da34c2b8f1c7496dd9a7f4;hb=6bbd4780e49f69a08ae373b5a07bd15b037013f7;hp=66e7b4e66c0514974780aa8a063d67be784acdb5;hpb=06a069adc1c7ab7a4267bb7ed3cdc35732d29dc1;p=ghc-base.git diff --git a/System/IO.hs b/System/IO.hs index 66e7b4e..1226fcc 100644 --- a/System/IO.hs +++ b/System/IO.hs @@ -1,16 +1,14 @@ {-# OPTIONS -fno-implicit-prelude #-} ----------------------------------------------------------------------------- --- +-- | -- Module : System.IO -- Copyright : (c) The University of Glasgow 2001 --- License : BSD-style (see the file libraries/core/LICENSE) +-- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : portable -- --- $Id: IO.hs,v 1.5 2002/02/27 14:32:23 simonmar Exp $ --- -- The standard IO library. -- ----------------------------------------------------------------------------- @@ -89,15 +87,19 @@ module System.IO ( readIO, -- :: Read a => String -> IO a readLn, -- :: Read a => IO a +#ifndef __HUGS__ hPutBuf, -- :: Handle -> Ptr a -> Int -> IO () hGetBuf, -- :: Handle -> Ptr a -> Int -> IO Int +#endif fixIO, -- :: (a -> IO a) -> IO a +#ifndef __HUGS__ hSetEcho, -- :: Handle -> Bool -> IO () hGetEcho, -- :: Handle -> IO Bool hIsTerminalDevice, -- :: Handle -> IO Bool +#endif ) where #ifdef __GLASGOW_HASKELL__ @@ -112,25 +114,17 @@ import GHC.Read import GHC.Show #endif -import Data.Dynamic -import Control.Monad.Fix -import System.IO.Error - --- ----------------------------------------------------------------------------- --- MonadFix instance - -instance MonadFix IO where - mfix = fixIO - --- ----------------------------------------------------------------------------- --- Typeable instance for Handle +#ifdef __HUGS__ +import Hugs.IO +import Hugs.IOExts +#endif -#include "Dynamic.h" -INSTANCE_TYPEABLE0(Handle,handleTc,"Handle") +import System.IO.Error -- ----------------------------------------------------------------------------- -- Standard IO +#ifndef __HUGS__ putChar :: Char -> IO () putChar c = hPutChar stdout c @@ -185,6 +179,7 @@ readIO s = case (do { (x,t) <- reads s ; [x] -> return x [] -> ioError (userError "Prelude.readIO: no parse") _ -> ioError (userError "Prelude.readIO: ambiguous parse") +#endif /* __HUGS__ */ hReady :: Handle -> IO Bool hReady h = hWaitForInput h 0