X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FIO.hs;h=f33a167bde470fc98dde647bff36f6cde4152d4d;hb=b8ac498face4c8b16c06d30fbc86666b7dc28173;hp=eee562cd8ed91287fa0110869849eed96cf894b9;hpb=b72dda8318394f238214364dc01b8963599f8cd6;p=ghc-base.git diff --git a/System/IO.hs b/System/IO.hs index eee562c..f33a167 100644 --- a/System/IO.hs +++ b/System/IO.hs @@ -6,7 +6,7 @@ -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org --- Stability : provisional +-- Stability : stable -- Portability : portable -- -- The standard IO library. @@ -149,6 +149,8 @@ module System.IO ( hSetBinaryMode, -- :: Handle -> Bool -> IO () hPutBuf, -- :: Handle -> Ptr a -> Int -> IO () hGetBuf, -- :: Handle -> Ptr a -> Int -> IO Int + hPutBufNonBlocking, -- :: Handle -> Ptr a -> Int -> IO Int + hGetBufNonBlocking, -- :: Handle -> Ptr a -> Int -> IO Int #endif module System.IO.Error, @@ -204,7 +206,7 @@ import IO , IO () , FilePath -- :: String ) -import NHC.Internal (unsafePerformIO) +import NHC.IOExtras (fixIO) #endif import System.IO.Error ( @@ -341,7 +343,7 @@ readIO s = case (do { (x,t) <- reads s ; #endif /* __HUGS__ */ -- | Computation 'hReady' @hdl@ indicates whether at least one item is --- available for input from handle "hdl". +-- available for input from handle @hdl@. -- -- This operation may fail with: -- @@ -377,10 +379,6 @@ hPrint hdl = hPutStrLn hdl . show fixIO :: (a -> IO a) -> IO a fixIO m = stToIO (fixST (ioToST . m)) #endif -#ifdef __NHC__ -fixIO :: (a -> IO a) -> IO a -fixIO f = let x = unsafePerformIO (f x) in return x -#endif -- $locking -- Implementations should enforce as far as possible, at least locally to the