src/args.bend source
src/args.bend on the hub · documented module
# shake/args: the process argv, each word reusable, internal (main.bend# exports it). `IO.args` answers a `&1` list; the rest of a program reads the# line more than once, so the walk copies it.import Base# a &1 list copied to &2def copy(xs: List<&1, String>) -> List<&2, String>: match xs: case Nil{}: Nil{} case Con{+h, t}: h <> copy(t)# the process argvdef argv() -> IO(List<&2, String>): # noqa: L001 IO: reads argv (SHAKE-TRUST-4) IO.bind(List<&1, String>, List<&2, String>, IO.args(), xs => IO.pure(List<&2, String>, copy(xs)))