Esempio n. 1
0
 @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()));
 }
Esempio n. 2
0
 @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);
 }