def execute
import bend-edit-distance@0.2.2.0/src/Batch.bend as Batchimport Base
153# Only ready, independent subplans enter parallel calls. A leaf uses the same
154# single-pair implementation; column carries and successive columns stay serial.
155def execute(plan: Plan) -> List<&2, IndexedResult>:
156 match plan:
157 case Empty{}:
158 Nil{}
159 case Leaf{index, job}:
160 [single(index, job)]
161 case Serial{jobs}:
162 serial(jobs)
163 case Fork{left, right}:
164 a b = execute(left) execute(right)
165 List.append(&2, IndexedResult, a, b)