-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : System.IO
#ifdef __GLASGOW_HASKELL__
import GHC.Base
-import GHC.Real
import GHC.IO hiding ( onException )
import GHC.IO.IOMode
import GHC.IO.Handle.FD
import qualified GHC.IO.FD as FD
import GHC.IO.Handle
-import GHC.IO.Handle.Text ( hGetBufSome )
+import GHC.IO.Handle.Text ( hGetBufSome, hPutStrLn )
import GHC.IORef
import GHC.IO.Exception ( userError )
import GHC.IO.Encoding
-- | The same as 'putStr', but adds a newline character.
putStrLn :: String -> IO ()
-putStrLn s = do putStr s
- putChar '\n'
+putStrLn s = hPutStrLn stdout s
-- | The 'print' function outputs a value of any printable type to the
-- standard output device.
hReady :: Handle -> IO Bool
hReady h = hWaitForInput h 0
--- | The same as 'hPutStr', but adds a newline character.
-
-hPutStrLn :: Handle -> String -> IO ()
-hPutStrLn hndl str = do
- hPutStr hndl str
- hPutChar hndl '\n'
-
-- | Computation 'hPrint' @hdl t@ writes the string representation of @t@
-- given by the 'shows' function to the file or channel managed by @hdl@
-- and appends a newline.
else ioError (errnoToIOError loc errno Nothing (Just tmp_dir))
else do
- (fD,fd_type) <- FD.mkFD (fromIntegral fd) ReadWriteMode Nothing{-no stat-}
+ (fD,fd_type) <- FD.mkFD fd ReadWriteMode Nothing{-no stat-}
False{-is_socket-}
True{-is_nonblock-}