{-# LANGUAGE Safe #-}
module Universum.Lifted.Env
( getArgs
, exitWith
, exitFailure
, exitSuccess
, die
) where
import Control.Monad.Trans (MonadIO, liftIO)
import Data.String (String)
import Prelude ((>>))
import System.Exit (ExitCode)
import System.IO (stderr)
import qualified System.Environment as XIO
import qualified System.Exit as XIO
import qualified System.IO (hPutStrLn)
getArgs :: MonadIO m => m [String]
getArgs = liftIO (XIO.getArgs)
{-# INLINE getArgs #-}
exitWith :: MonadIO m => ExitCode -> m a
exitWith a = liftIO (XIO.exitWith a)
{-# INLINE exitWith #-}
exitFailure :: MonadIO m => m a
exitFailure = liftIO XIO.exitFailure
{-# INLINE exitFailure #-}
exitSuccess :: MonadIO m => m a
exitSuccess = liftIO XIO.exitSuccess
{-# INLINE exitSuccess #-}
die :: MonadIO m => String -> m ()
die err = liftIO (System.IO.hPutStrLn stderr err) >> exitFailure
{-# INLINE die #-}