scala / collection-strawman

Implementation of the new Scala 2.13 Collections
Apache License 2.0
200 stars 72 forks source link

Rename IndexedView to IndexedSeqView #477

Closed julienrf closed 6 years ago

Ichoran commented 6 years ago

As I mentioned in the comment, I would as soon change IndexedSeqOps to IndexedOps; I don't believe there's any other sensible way to get indexing (especially since "Indexed" doesn't just mean that you can find an index--you can do that with LinearSeq and SortedSet and stuff too--it really means that indexing is efficient and natural).

szeiger commented 6 years ago

I agree that Seq is redundant in principle but Indexed wouldn't make a good name to replace IndexedSeq. Since IndexedSeqOps is the ops trait for IndexedSeq, it should be called IndexedSeqOps and not IndexedOps. This is consistent with other ops traits.

I have a slight preference for IndexedView over IndexedSeqView because Seq is redundant and unimportant for the view. OTOH, you get a MapView from a Map and a SeqView from a Seq so it makes sense that you get an IndexedSeqView from an IndexedSeq.

SethTisue commented 6 years ago

I'd suggest favoring consistency/regularity here. One less thing to remember.

For frequently used names, sometimes brevity can win, but this isn't going to be a frequently used name. In most uses, the type will be inferred and not appear in source.