File: Environment.hs

package info (click to toggle)
haskell-basement 0.0.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,048 kB
  • sloc: haskell: 11,336; ansic: 63; makefile: 5
file content (16 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)