Concurrency.par_reduce.list.top: def of bend-kit-concurrency@0.2.0.0 Import: import bend-kit-concurrency@0.2.0.0/concurrency.bend as Concurrency Lines 99-107 of bend-kit-concurrency@0.2.0.0/concurrency.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-concurrency@0.2.0.0/concurrency.bend&start_line=99&end_line=107 import Base def par_reduce.list.top(~A: Data, ~f: A -> A -> A, d: Nat, +z: A, nx: Nat & List) -> A: match d: case 0n: (n, xs) = nx fold(~A, ~f, xs, z) case 1n+p: (+n, xs) = nx +h = Nat.div(n, 2n) par_reduce.list.go(~A, ~f, p, h, Nat.sub(n, h), z, split(A, xs, h)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bend-kit-concurrency@0.2.0.0/concurrency.bend&name=fold https://jend.leeeet.dev/definition.txt?path=bend-kit-concurrency@0.2.0.0/concurrency.bend&name=par_reduce.list.go https://jend.leeeet.dev/definition.txt?path=bend-kit-concurrency@0.2.0.0/concurrency.bend&name=split