haskell2020-0.1.0.0: Haskell 2020[draft] Standard Library

Safe HaskellSafe
LanguageHaskell2010

System.Environment

Synopsis

Documentation

getArgs :: IO [String] #

Computation getArgs returns a list of the program's command line arguments (not including the program name).

getProgName :: IO String #

Computation getProgName returns the name of the program as it was invoked.

However, this is hard-to-impossible to implement on some non-Unix OSes, so instead, for maximum portability, we just return the leafname of the program as invoked. Even then there are some differences between platforms: on Windows, for example, a program invoked as foo is probably really FOO.EXE, and that is what getProgName will return.

getEnv :: String -> IO String #

Computation getEnv var returns the value of the environment variable var. For the inverse, the setEnv function can be used.

This computation may fail with: