module Control.Shell.Handle (
IO.BufferMode (..),
hPutStr, hPutStrLn,
hGetLine, hGetContents,
hGetBytes, hPutBytes, hGetByteLine, hGetByteContents,
hReady, hFlush, hClose,
hGetBuffering, hSetBuffering
) where
import qualified System.IO as IO
import qualified Data.ByteString as BS
import Control.Shell.Base
hPutStr :: IO.Handle -> String -> Shell ()
hPutStr h s = unsafeLiftIO $ IO.hPutStr h s
hPutStrLn :: IO.Handle -> String -> Shell ()
hPutStrLn h s = unsafeLiftIO $ IO.hPutStrLn h s
hClose :: IO.Handle -> Shell ()
hClose = unsafeLiftIO . IO.hClose
hFlush :: IO.Handle -> Shell ()
hFlush = unsafeLiftIO . IO.hFlush
hReady :: IO.Handle -> Shell Bool
hReady = unsafeLiftIO . IO.hReady
hSetBuffering :: IO.Handle -> IO.BufferMode -> Shell ()
hSetBuffering h = unsafeLiftIO . IO.hSetBuffering h
hGetBuffering :: IO.Handle -> Shell IO.BufferMode
hGetBuffering = unsafeLiftIO . IO.hGetBuffering
hGetLine :: IO.Handle -> Shell String
hGetLine = unsafeLiftIO . IO.hGetLine
hGetContents :: IO.Handle -> Shell String
hGetContents = unsafeLiftIO . IO.hGetContents
hGetBytes :: IO.Handle -> Int -> Shell BS.ByteString
hGetBytes h = unsafeLiftIO . BS.hGet h
hGetByteLine :: IO.Handle -> Shell BS.ByteString
hGetByteLine = unsafeLiftIO . BS.hGetLine
hGetByteContents :: IO.Handle -> Shell BS.ByteString
hGetByteContents = unsafeLiftIO . BS.hGetContents
hPutBytes :: IO.Handle -> BS.ByteString -> Shell ()
hPutBytes h = unsafeLiftIO . BS.hPutStr h