def halve
import bend-visgraph@2.0.0.0/parallel.bend as Parallelimport Base
103def halve(k: Nat, cs: Chunks, +na: U32, +total: U32, acc: Chunks) -> Halves:
104 match k cs:
105 case 1n+q CCon{+start, +count, next}:
106 halve(q, next, na, total, CCon{start, count, acc})
107 case _ _:
108 Halves{acc, na, cs, (total - na : U32)}