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

Proposal to add yielder.prepend #1

Closed
JosephTLyons opened this issue Nov 27, 2024 · 1 comment · Fixed by #2
Closed

Proposal to add yielder.prepend #1

JosephTLyons opened this issue Nov 27, 2024 · 1 comment · Fixed by #2
Labels
good first issue Good for newcomers help wanted Contributions encouraged

Comments

@JosephTLyons
Copy link
Contributor

JosephTLyons commented Nov 27, 2024

I'm proposing there be a prepend function in yielder. The yielder API seems to closely match the list API. list has prepend. Additionally, yielder has yield, which does a prepend, but is a bit awkward to use in pipes. A prepend method would be convenient and as simple as:

pub fn prepend(yielder: Yielder(a), element: a) -> Yielder(a) {
  use <- yielder.yield(element)
  yielder
}
@JosephTLyons JosephTLyons changed the title Add yielder.prepend Proposal to add yielder.prepend Nov 27, 2024
@lpil
Copy link
Member

lpil commented Nov 27, 2024

Sounds fab to me!

@lpil lpil added good first issue Good for newcomers help wanted Contributions encouraged labels Nov 27, 2024
@JosephTLyons JosephTLyons mentioned this issue Nov 27, 2024
@lpil lpil closed this as completed in #2 Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Contributions encouraged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants