fn chunked_sum<T>( chunks: usize, range: impl Fn(usize) -> Range<usize> + Sync, f: impl Fn(usize) -> T + Sync, ) -> Twhere T: Copy + Send + Sync + Add<Output = T> + Default,
f summed over each of chunks ranges in order, then the partial sums in order
f
chunks