Module System.Environment

Author
Michael Hanus, Bernd Brassel, Bjoern Peemoeller
Version
November 2020

Library to access parts of the system environment.

Exported Functions


getArgs :: IO [String]  Deterministic 

Returns the list of the program's command line arguments. The program name is not included.

Further infos:
  • externally defined

getEnv :: String -> IO String  Deterministic 

Returns the value of an environment variable. The empty string is returned for undefined environment variables.


setEnv :: String -> String -> IO ()  Deterministic 

Set an environment variable to a value. The new value will be passed to subsequent shell commands and visible to subsequent calls to getEnv (but it is not visible in the environment of the process that started the program execution).


unsetEnv :: String -> IO ()  Deterministic 

Removes an environment variable that has been set by setEnv.


getHostname :: IO String  Deterministic 

Returns the hostname of the machine running this process.

Further infos:
  • externally defined

getProgName :: IO String  Deterministic 

Returns the name of the current program, i.e., the name of the main module currently executed.

Further infos:
  • externally defined

isPosix :: Bool  Deterministic 

Is the underlying operating system a POSIX system (unix, MacOS)?


isWindows :: Bool  Deterministic 

Is the underlying operating system a Windows system?

Further infos:
  • externally defined