packages feed

relude-1.2.2.1 / src / Relude / Lifted / Env.hs

{-# LANGUAGE Safe #-}{- |Module                  : Relude.Lifted.EnvCopyright               : (c) 2020-2023 KowainikSPDX-License-Identifier : MITMaintainer              : Kowainik <xrom.xkov@gmail.com>Stability               : StablePortability             : PortableLifted functions to work with system environment.@since 1.0.0.0-}module Relude.Lifted.Env    ( getArgs    , lookupEnv    ) whereimport Relude.Base (IO)import Relude.Function ((.))import Relude.Monad.Reexport (MonadIO (..), Maybe)import Relude.String.Reexport (String)import qualified System.Environment as ENV (getArgs, lookupEnv){- | Lifted version of 'System.Environment.getArgs'.@since 1.0.0.0-}getArgs :: MonadIO m => m [String]getArgs = liftIO ENV.getArgs{-# SPECIALIZE getArgs :: IO [String] #-}{-# INLINE getArgs #-}{- | Lifted version of 'System.Environment.lookupEnv'.@since 1.0.0.0-}lookupEnv :: MonadIO m => String -> m (Maybe String)lookupEnv = liftIO . ENV.lookupEnv{-# SPECIALIZE lookupEnv :: String -> IO (Maybe String) #-}{-# INLINE lookupEnv #-}