[ CCode ( ordering = 4 ) ]
public virtual Iterator<A> scan<A> (FoldFunc<A,G> f, owned A seed)
Creates a new iterator that is initially pointing to seed. Then subsequent values are obtained after applying the function to previous value and the subsequent items.
The resulting iterator is always valid and it contains the seed value.
Default implementation uses stream.
When the method is called on Iterator using the parent iterator is not allowed befor the inner iterator Iterator.next return false and then it points on its last element. The resulting iterator is Iterator.valid.
f |
Folding function |
seed |
original seed value |
Iterator containing values of subsequent values of seed |