A
- The Iterable element typeB
- The accumulation typepublic final class ScanLeft<A,B> extends Object implements Fn3<Fn2<? super B,? super A,? extends B>,B,Iterable<A>,Iterable<B>>
Iterable
of A
s, a starting value B
, and a
Fn2
<B, A, B>
, iteratively accumulate over the Iterable
, collecting each
function application result, finally returning an Iterable
of all the results. Note that, as the name
implies, this function accumulates from left to right, such that scanLeft(f, 0, asList(1,2,3,4,5))
is
evaluated as 0, f(0, 1), f(f(0, 1), 2), f(f(f(0, 1), 2), 3), f(f(f(f(0, 1), 2), 3), 4), f(f(f(f(f(0, 1), 2),
3), 4), 5)
.FoldLeft
Modifier and Type | Method and Description |
---|---|
Iterable<B> |
checkedApply(Fn2<? super B,? super A,? extends B> fn,
B b,
Iterable<A> as) |
static <A,B> ScanLeft<A,B> |
scanLeft() |
static <A,B> Fn2<B,Iterable<A>,Iterable<B>> |
scanLeft(Fn2<? super B,? super A,? extends B> fn) |
static <A,B> Fn1<Iterable<A>,Iterable<B>> |
scanLeft(Fn2<? super B,? super A,? extends B> fn,
B b) |
static <A,B> Iterable<B> |
scanLeft(Fn2<? super B,? super A,? extends B> fn,
B b,
Iterable<A> as) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, fn3, fn3, fn3, uncurry, widen
checkedApply, curried, curry, fn2, fromBiFunction, toBiFunction
public Iterable<B> checkedApply(Fn2<? super B,? super A,? extends B> fn, B b, Iterable<A> as)
public static <A,B> ScanLeft<A,B> scanLeft()
public static <A,B> Fn2<B,Iterable<A>,Iterable<B>> scanLeft(Fn2<? super B,? super A,? extends B> fn)
public static <A,B> Fn1<Iterable<A>,Iterable<B>> scanLeft(Fn2<? super B,? super A,? extends B> fn, B b)