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

List - varargs for Append, NewList, Prepend #31

Closed
laher opened this issue Dec 24, 2022 · 1 comment
Closed

List - varargs for Append, NewList, Prepend #31

laher opened this issue Dec 24, 2022 · 1 comment

Comments

@laher
Copy link
Contributor

laher commented Dec 24, 2022

Would it be desirable to amend the signatures for these List operations?

e.g.

func (l *List[T]) Append(value ...T) *List[T] {

2 benefits:

  • Ergonomics: no need for ListBuilder in many cases
  • Efficiently add multiple to an existing List

Being varargs, it wouldn't break existing callers.

Note that we could implement something similar for maps - maybe a SetAll(map[k]v) but that could be separate.

I'm happy to submit a PR for this

@laher
Copy link
Contributor Author

laher commented Dec 24, 2022

Duh, I missed this: #18.

I could implement it under that one

@laher laher closed this as completed Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant