def ups.go
import ezx@1.11.0.0/src/pkg/path.bend as Pathimport Base
155# the climbs among components counted one at a time. Base's `List.filter`
156# applies an erased function parameter, so it falls outside the termination
157# check; this count is structural.
158def ups.go(ps: List<&2, String>) -> Nat:
159 match ps:
160 case []:
161 0n
162 case +h <> t:
163 Nat.add(Bool.pick(Nat, up.is(h), 1n, 0n), ups.go(t))