silo:std.effects.env

Source src/silo:std.effects.env

1##! Process environment — command-line args, env vars, and process exit.
2
3:use
4  :open core Str Never AnyInt Option Vec
5  :open effects.io IO
6:end
7
8## Process environment effect: command-line args, env vars, and process exit.
9:effect(pub) Env IO
10  ## Returns the program's command-line arguments as a vector of strings.
11  .args ( -> (Vec Str) )
12  ## Returns the value of an environment variable or `None` if unset.
13  .get-env ( Str -> (Option Str) )
14  ## Terminates the process with the given exit code; never returns.
15  .exit ( AnyInt -> Never )
16:end