static L mapWithIndex(L l, IF2 f) { L out = emptyList(l); for i over l: out.add(f.get(i, l.get(i))); ret out; } static L mapWithIndex(IF2 f, L l) { ret mapWithIndex(l, f); }