{-# LANGUAGE ExplicitForAll #-}
module Relude.Lifted.Terminal
( getLine
, print
, putStr
, putStrLn
) where
import Relude.Base (IO, Show, String)
import Relude.Function ((.))
import Relude.Monad.Reexport (MonadIO (..))
import Relude.String.Reexport (Text)
import qualified Data.Text.IO as TIO
import qualified System.IO as IO (print, putStr, putStrLn)
getLine :: MonadIO m => m Text
getLine = liftIO TIO.getLine
{-# SPECIALIZE getLine :: IO Text #-}
{-# INLINE getLine #-}
print :: forall a m . (MonadIO m, Show a) => a -> m ()
print = liftIO . IO.print
{-# SPECIALIZE print :: Show a => a -> IO () #-}
{-# INLINE print #-}
putStr :: MonadIO m => String -> m ()
putStr = liftIO . IO.putStr
{-# SPECIALIZE putStr :: String -> IO () #-}
{-# INLINE putStr #-}
putStrLn :: MonadIO m => String -> m ()
putStrLn = liftIO . IO.putStrLn
{-# SPECIALIZE putStrLn :: String -> IO () #-}
{-# INLINE putStrLn #-}