[ CCode ( ordering = 8 ) ]
public virtual Iterator<A> flat_map<A> (owned FlatMapFunc<A,G> f)
A fused concatenate and map. The function is applied to each element of iteration and the resulting values are concatenated.
The iterator is lazy evaluated but value is force-evaluated when iterator is moved to next value.
Default implementation uses stream.
In Iterator implementation if the parent iterator is Iterator.valid and function returns a valid iterator the resulting iterator is also valid. Using the parent iterator is not allowed before the inner iterator Iterator.next return false and then it points on its last element.
f |
mapping function |
Iterator over returned values |
0.11.1