-- |
-- Module      : Foundation.IO.Terminal
-- License     : BSD-style
-- Maintainer  : Foundation
-- Stability   : experimental
-- Portability : portable
--
module Foundation.IO.Terminal
    ( putStrLn
    , putStr
    , stdin
    , stdout
    , getArgs
    , exitFailure
    , exitSuccess
    ) where

import           Basement.Imports
import qualified Prelude
import           System.IO (stdin, stdout)
import           System.Exit
import qualified System.Environment as SE (getArgs)

-- | Print a string to standard output
putStr :: String -> IO ()
putStr :: String -> IO ()
putStr = String -> IO ()
Prelude.putStr (String -> IO ()) -> (String -> String) -> String -> IO ()
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. String -> String
forall l. IsList l => l -> [Item l]
toList

-- | Print a string with a newline to standard output
putStrLn :: String -> IO ()
putStrLn :: String -> IO ()
putStrLn = String -> IO ()
Prelude.putStrLn (String -> IO ()) -> (String -> String) -> String -> IO ()
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. String -> String
forall l. IsList l => l -> [Item l]
toList

-- | Get the arguments from the terminal command
getArgs :: IO [String]
getArgs :: IO [String]
getArgs = (String -> String) -> [String] -> [String]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> String
forall l. IsList l => [Item l] -> l
fromList ([String] -> [String]) -> IO [String] -> IO [String]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO [String]
SE.getArgs