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 ();
| fn |
the action to execute on each element. |
|
the same Stream (for chaining). |