def Drv.inputs.par
bend-kube-runtime@0.2.0.0 · src/runtime.bend:84
import bend-kube-runtime@0.2.0.0/src/runtime.bend as Runtime
import Base
import bend-kube-runtime@0.2.0.0/src/watcher.bend as W
84
85
86
87def Drv.inputs.par(+depth: Nat, +ls: List<&2, List<&2, U32>>) -> List<&2, W.Input>:
88 match depth:
89 case 0n:
90 Drv.inputs(ls)
91 case 1n+d:
92 +half = Nat.div(List.length(&2, List<&2, U32>, ls), 2n)
93 a b = Drv.inputs.par(d, List.take(&2, List<&2, U32>, ls, half)) Drv.inputs.par(d, List.drop(&2, List<&2, U32>, ls, half))
94 List.append(&2, W.Input, a, b)