Initial commit
This commit is contained in:
commit
c101616e62
309 changed files with 53937 additions and 0 deletions
21
bundled/Basement/Environment.hs
Normal file
21
bundled/Basement/Environment.hs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{-# LANGUAGE BangPatterns #-}
|
||||
{-# LANGUAGE DeriveDataTypeable #-}
|
||||
{-# LANGUAGE TypeFamilies #-}
|
||||
{-# LANGUAGE RebindableSyntax #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
module Basement.Environment
|
||||
( getArgs
|
||||
, lookupEnv
|
||||
) where
|
||||
|
||||
import Basement.Compat.Base
|
||||
import Basement.UTF8.Base (String)
|
||||
import qualified System.Environment as Sys (getArgs, lookupEnv)
|
||||
|
||||
-- | Returns a list of the program's command line arguments (not including the program name).
|
||||
getArgs :: IO [String]
|
||||
getArgs = fmap fromList <$> Sys.getArgs
|
||||
|
||||
-- | Lookup variable in the environment
|
||||
lookupEnv :: String -> IO (Maybe String)
|
||||
lookupEnv s = fmap fromList <$> Sys.lookupEnv (toList s)
|
||||
Loading…
Add table
Add a link
Reference in a new issue