def cand
import ezx@1.11.0.0/src/fetch/plan.bend as Planimport Base
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/pkg/pkg.bend as K
136# every file the lock names, with the text the tree has at its path. A file
137# the tree does not have is taken as empty, which does not match the lock
138# unless the lock records an empty file.
139def cand(fs: List<&2, K.Item>, +root: String, +tree: List<&2, K.Source>) -> List<&2, W.Source>:
140 match fs:
141 case []:
142 []
143 case K.Item{+at, _sum} <> t:
144 W.Source{at, text.or(K.look(tree, key(root, at)))} <> cand(t, root, tree)