map


Description:

[ CCode ( ordering = 3 ) ]
public virtual Iterator<A> map<A> (MapFunc<A,G> f)

Produces an iterator pointing at elements generated by function passed.

Iterator is lazy evaluated but value is force-evaluated when iterator moves to next element. ( Iterator.next)

Note:

Default implementation uses stream.

Note:

In Iterator implementation if the parent iterator is Iterator.valid so is the returned one. Using the parent iterator is not allowed before the inner iterator Iterator.next return false and then it points on its last element. The resulting iterator is Iterator.valid if the parent iterator is.

Parameters:

f

Mapping function

Returns:

Iterator listing mapped value