benbjohnson / immutable

Immutable collections for Go
MIT License
713 stars 32 forks source link

List - varargs for Append, NewList, Prepend #31

Closed laher closed 1 year ago

laher commented 1 year ago

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:

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 commented 1 year ago

Duh, I missed this: https://github.com/benbjohnson/immutable/issues/18.

I could implement it under that one