import java.util.concurrent.ExecutorService; import java.util.function.*; abstract class List { public abstract int length(); public abstract B foldLeft(B identity, Function> f); public abstract List map(Function f); public abstract List flatMap(Function> f); public List> splitListAt(int i) { return null; } public List> divide(List> list, int depth) { final List> divide = divide(list.flatMap(x -> x.splitListAt(x.length() / 2)), depth / 2); return null; } public void parFoldLeft(ExecutorService es, C identity, Function> f, List> dList) { dList.map(x -> es.submit(() -> x.foldLeft(identity, f))); } }