@Override public <U> Array<U> scanLeft(U zero, BiFunction<? super U, ? super T, ? extends U> operation) { Objects.requireNonNull(operation, "operation is null"); return Collections.scanLeft( this, zero, operation, new java.util.ArrayList<>(), (c, u) -> { c.add(u); return c; }, list -> Array.wrap(list.toArray())); }
@Override default <U> Seq<U> scanLeft(U zero, BiFunction<? super U, ? super T, ? extends U> operation) { Objects.requireNonNull(operation, "operation is null"); return Collections.scanLeft(this, zero, operation, List.empty(), List::prepend, List::reverse); }