def par_map.list.top
import bend-kit-concurrency@0.2.0.0/concurrency.bend as Concurrencyimport Base
61def par_map.list.top(~A: Type, ~B: Type, ~f: A -> B, d: Nat, nx: Nat & List<A>) -> List<B>:
62 match d:
63 case 0n:
64 (n, xs) = nx
65 List.map(~A, ~B, ~f, xs)
66 case 1n+p:
67 (+n, xs) = nx
68 +h = Nat.div(n, 2n)
69 par_map.list.go(~A, ~B, ~f, p, h, Nat.sub(n, h), split(A, xs, h))