Open
Description
IMHO it is pretty common to wanting to create a collection of a single element. Whereas you can always use the apply
that accepts a varargs, I personally would prefer to call a single
method on the companion object of the collection I want.
My arguments are:
- I find such method to better show the intent.
- Such a method could be more efficient, especially because one would avoid the intermediate Seq that is allocated for the varargs.
- Iterator already has
single
.