def vars

shake@0.7.0.0 · src/args.bend:42

import shake@0.7.0.0/src/args.bend as Args
import Base
import shake@0.7.0.0/src/cli.bend as C

42# the names that are set, each with its value, in order
43def vars(names: List<&2, String>) -> IO(List<&2, C.Var>):  # noqa: L001 IO: reads env vars (SHAKE-TRUST-5)
44  match names:
45    case Nil{}:
46      IO.pure(List<&2, C.Var>, [])
47    case Con{+hh, tt}:
48      IO.bind(Result<&1, &1, U32 & String, String>, List<&2, C.Var>, IO.get_env(hh),
49        got => IO.bind(List<&2, C.Var>, List<&2, C.Var>, vars(tt),
50          rest => IO.pure(List<&2, C.Var>, kept(hh, got, rest))))

Uses (11)

Used by (1)