System.Env

lib/System/Env.gob

The process's own environment: what it was asked to do, and how it answers.

main keeps the type it has always had, fun() -> Unit (turkey/driver.py). A program that wants a non-zero status calls exit, which diverges, so the entry point's shape does not have to move in order to carry one.

fun args : fun() -> Array String

The program's arguments, its own name not among them.

Built on demand from the bytes argv points at. An argument that is not well-formed UTF-8 panics: a String is UTF-8 by construction, and one that broke that would break the invariant every other door checks.

fun exit : fun(Int) -> a
fun get : fun(String) -> Option String

The value of an environment variable, or None if it is unset or is not well-formed UTF-8.

fun currentDirectory : fun() -> Option String

The working directory's absolute path, or None if it cannot be read or is not well-formed UTF-8.

fun executablePath : fun() -> Option String

The running executable's absolute path, with every symbolic link resolved, or None if the system cannot say or the path is not well-formed UTF-8. A program started through a symbolic link gets the file the link points to.

fun resolvedPath : fun(String) -> Option String

Returns path as an absolute path with every symbolic link, . and .. resolved, or None if it names nothing that exists, cannot be read, or the result is not well-formed UTF-8. A relative path is resolved against the working directory.