module Relude.Lifted.Handle
( hFlush
, hIsEOF
, hSetBuffering
, hGetBuffering
, Handle
, stdin
, stdout
, stderr
, withFile
, BufferMode (..)
) where
import Relude.Base (IO)
import Relude.Function ((.))
import Relude.Bool (Bool (..))
import Relude.Monad.Reexport (MonadIO (..))
import qualified System.IO as IO (Handle, hFlush, hIsEOF, hSetBuffering, hGetBuffering, BufferMode)
import System.IO (Handle, stdin, stdout, stderr, withFile, BufferMode (..))
hFlush :: MonadIO m => IO.Handle -> m ()
hFlush :: forall (m :: * -> *). MonadIO m => Handle -> m ()
hFlush = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> (Handle -> IO ()) -> Handle -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Handle -> IO ()
IO.hFlush
{-# SPECIALIZE hFlush :: IO.Handle -> IO () #-}
{-# INLINE hFlush #-}
hIsEOF :: MonadIO m => IO.Handle -> m Bool
hIsEOF :: forall (m :: * -> *). MonadIO m => Handle -> m Bool
hIsEOF = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> (Handle -> IO Bool) -> Handle -> m Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Handle -> IO Bool
IO.hIsEOF
{-# SPECIALIZE hIsEOF :: IO.Handle -> IO Bool #-}
{-# INLINE hIsEOF #-}
hSetBuffering :: MonadIO m => IO.Handle -> IO.BufferMode -> m ()
hSetBuffering :: forall (m :: * -> *). MonadIO m => Handle -> BufferMode -> m ()
hSetBuffering Handle
h = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> (BufferMode -> IO ()) -> BufferMode -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Handle -> BufferMode -> IO ()
IO.hSetBuffering Handle
h
{-# SPECIALIZE hSetBuffering :: IO.Handle -> IO.BufferMode -> IO () #-}
{-# INLINE hSetBuffering #-}
hGetBuffering :: MonadIO m => IO.Handle -> m IO.BufferMode
hGetBuffering :: forall (m :: * -> *). MonadIO m => Handle -> m BufferMode
hGetBuffering = IO BufferMode -> m BufferMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferMode -> m BufferMode)
-> (Handle -> IO BufferMode) -> Handle -> m BufferMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Handle -> IO BufferMode
IO.hGetBuffering
{-# SPECIALIZE hGetBuffering :: IO.Handle -> IO IO.BufferMode #-}
{-# INLINE hGetBuffering #-}