Process Module
Process control, environment, and timing operations.
Functions
Process.args
() -> [String]
Return the command-line arguments passed to the program.
import Process
Process.args ()
-- ["arg1", "arg2", ...]Try itNotes: Excludes the program name. Takes Unit to trigger execution.
See also: Process.env
Process.env
String -> Maybe String
Get the value of an environment variable.
import Process
Process.env "PATH"
-- Just "/usr/bin:..."Try itSee also: Process.setEnv, Process.args
Process.exit
Int -> ()
Exit the process with the given exit code.
import Process
Process.exit 0Try itNotes: This function never returns.
Process.hostname
() -> String
Return the hostname of the machine running the current process.
import Process
Process.hostname ()
-- e.g. "myhost"Try itNotes: Returns "unknown" if the hostname cannot be determined. Takes Unit to trigger execution.
See also: Process.pid
Process.pid
() -> Int
Return the process ID of the current process.
import Process
Process.pid ()
-- e.g. 12345Try itNotes: Takes Unit to trigger execution.
See also: Process.hostname
Process.setEnv
String -> String -> ()
Set an environment variable. KEEL_* variables cannot be set.
import Process
Process.setEnv "MY_VAR" "my_value"Try itNotes: Changes only affect the current process. Setting KEEL_* variables is an error.
See also: Process.env
Process.uptime
() -> Int
Return the number of milliseconds since the current program began executing.
import Process
Process.uptime ()
-- e.g. 42Try itNotes: Takes Unit to trigger execution.
See also: Process.wait
Process.wait
Int -> ()
Sleep for the given number of milliseconds. Blocks the current thread.
import Process
Process.wait 500Try itNotes: Negative values are treated as zero.
See also: Process.uptime