Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peek extension method for Iterable and Iterator #9

Open
2 tasks
Boereck opened this issue Apr 27, 2018 · 0 comments
Open
2 tasks

Add peek extension method for Iterable and Iterator #9

Boereck opened this issue Apr 27, 2018 · 0 comments

Comments

@Boereck
Copy link
Member

Boereck commented Apr 27, 2018

Analogous to the JDK method java.lang.Stream#peek(java.util.function.Consumer) introduce a peek extension method for Iterable and Iterator. This method just consumes an element and produces an Iterable/Iterator providing the same elements as the source. This method is mainly interesting for debugging purposes.

  • static def <T> Iterable<T> peek(Iterable<T> iterable, (T)=>void action)
  • static def <T> Iterator<T> peek(Iterator<T> iterator, (T)=>void action)

If you want this ticket to be implemented, please give feedback, since it is only implemented on demand.

Boereck added a commit that referenced this issue Apr 27, 2018
Created tickets #8 and #9 for combinations and peek extension method
ideas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant