let rec fold2i xs ys ~init ~f = match next xs, next ys with | Some x, Some y -> let init = f (count xs - 1) (count ys - 1) init x y in fold2i xs ys ~init ~f | _ -> init