public static <T> ReactiveSeq<T> of(T value){ return syncStream(new SingleValueOperator<T>(value)); }
@Override public final <U> ReactiveSeq<U> scanLeft(final U seed, final BiFunction<? super U, ? super T, ? extends U> function) { Supplier<Function<? super T, ? extends Object>> scanLeft = () -> { Object[] current = {seed}; return in -> current[0] = function.apply((U) current[0], in); }; return createSeq(new ArrayConcatonatingOperator<>(new SingleValueOperator<U>(seed), extract((ReactiveSeq<U>) mapLazyFn(scanLeft)))); }
public Operator<Integer> createOne(){ return new FilterOperator<>(new SingleValueOperator<>(1), i->true); }
public Operator<Integer> createOne(){ return new MapOperator<Integer,Integer>(new SingleValueOperator<>(1), i->i*2); }
public Operator<Integer> createOne(){ return new SkipOperator<>(new SingleValueOperator<>(1), 0); }
public Operator<Integer> createOne(){ return new FlatMapOperator<Integer,Integer>(new SingleValueOperator<>(1), i->Spouts.of(i*2)); }
public Operator<Integer> createOne(){ return new FlatMapOperator<Integer,Integer>(new SingleValueOperator<>(1), i->Spouts.of(i*2)); }
public Operator<Integer> createOne(){ return new FlatMapOperator<Integer,Integer>(new SingleValueOperator<>(1), i->asyncSpout(i)); }
public static <T> ReactiveSeq<T> of(T value){ return syncStream(new SingleValueOperator<T>(value)); }
@Override public final <U> ReactiveSeq<U> scanLeft(final U seed, final BiFunction<? super U, ? super T, ? extends U> function) { Supplier<Function<? super T, ? extends Object>> scanLeft = () -> { Object[] current = {seed}; return in -> current[0] = function.apply((U) current[0], in); }; return createSeq(new ArrayConcatonatingOperator<>(new SingleValueOperator<U>(seed), extract((ReactiveSeq<U>) mapLazyFn(scanLeft)))); }