def choice_bad
import cli@0.2.0.0/cli.bend as Cliimport Base
2125# The first choice the arg's type rejects; after a hit it only walks the rest.
2126def choice_bad(values: List<&2, String>, +found: Maybe<&2, ValueType>,
2127 bad: Maybe<&2, Bad>) -> Maybe<&2, Bad>:
2128 match values bad:
2129 case Nil{} hit: hit
2130 case value <> tail Some{hit}: Some{hit}
2131 case +value <> tail None{}:
2132 choice_bad(tail, found, bad_value(reason_from_type(found, value), value))