peek


Description:

public Stream<T> peek (owned ConsumerFunc<T> fn)

Executes an action on each element and returns the same Stream. Useful for debugging pipeline contents.

Example:

    stream.peek ((x) => { print ("%s\n", x); }).toList ();

Parameters:

fn

the action to execute on each element.

Returns:

the same Stream (for chaining).