Module System

Library to access parts of the system environment.

Author: Michael Hanus, Bernd Brassel, Bjoern Peemoeller

Version: July 2012

Summary of exported operations:

getCPUTime :: IO Int   
Returns the current cpu time of the process in milliseconds.
getElapsedTime :: IO Int   
Returns the current elapsed time of the process in milliseconds.
getArgs :: IO [String]   
Returns the list of the program's command line arguments.
getEnviron :: String -> IO String   
Returns the value of an environment variable.
setEnviron :: String -> String -> IO ()   
Set an environment variable to a value.
unsetEnviron :: String -> IO ()   
Removes an environment variable that has been set by setEnviron.
getHostname :: IO String   
Returns the hostname of the machine running this process.
getPID :: IO Int   
Returns the process identifier of the current Curry process.
getProgName :: IO String   
Returns the name of the current program, i.e., the name of the main module currently executed.
system :: String -> IO Int   
Executes a shell command and return with the exit code of the command.
exitWith :: Int -> IO a   
Terminates the execution of the current Curry program and returns the exit code given by the argument.
sleep :: Int -> IO ()   
The evaluation of the action (sleep n) puts the Curry process asleep for n seconds.
isPosix :: Bool   
Is the underlying operating system a POSIX system (unix, MacOS)?
isWindows :: Bool   
Is the underlying operating system a Windows system?

Exported operations:

getCPUTime :: IO Int   

Returns the current cpu time of the process in milliseconds.

Further infos:
  • externally defined

getElapsedTime :: IO Int   

Returns the current elapsed time of the process in milliseconds. This operation is not supported in KiCS2 (there it always returns 0), but only included for compatibility reasons.

Further infos:
  • externally defined

getArgs :: IO [String]   

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

Further infos:
  • externally defined

getEnviron :: String -> IO String   

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

setEnviron :: String -> String -> IO ()   

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

unsetEnviron :: String -> IO ()   

Removes an environment variable that has been set by setEnviron.

getHostname :: IO String   

Returns the hostname of the machine running this process.

Further infos:
  • externally defined

getPID :: IO Int   

Returns the process identifier of the current Curry process.

Further infos:
  • externally defined

getProgName :: IO String   

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

Further infos:
  • externally defined

system :: String -> IO Int   

Executes a shell command and return with the exit code of the command. An exit status of zero means successful execution.

exitWith :: Int -> IO a   

Terminates the execution of the current Curry program and returns the exit code given by the argument. An exit code of zero means successful execution.

sleep :: Int -> IO ()   

The evaluation of the action (sleep n) puts the Curry process asleep for n seconds.

isPosix :: Bool   

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

isWindows :: Bool   

Is the underlying operating system a Windows system?

Further infos:
  • externally defined