module Control.Shell.Handle (
hPutStr, hPutStrLn,
hGetLine, hGetContents,
hGetBytes, hPutBytes, hGetByteLine, hGetByteContents,
hFlush, hClose
) 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
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