Hi all, every now and then I come accross the sentiment that you should never code against
Seq but instead use a concrete collection such as
Vector. The reasons given vary, but I most often see:
While 1. has been somewhat fixed with 2.13 (since the
Seq type in the
scala package object now points to
immutable.Seq), number 2. still stands. Where separating finite and infinite collections ever considered for the strawman? And if so, what where the pros and cons?
IndexedSeqare mostly pretty good
Streamwill probably break everything. (Now,
LazyList.) Maybe we should remove it from the hierarchy. Make it an
Iterable, if even that.
Iterableif it happens to iterate in the same order, that's its choice. You aren't promised that this will be the case.
Seqbut not an
Statelike Sébastien suggested would probably be better in that regard
droprequires an immediate
isEmptycall, which forces the
LazyList, if it's meant to be fully lazy, should be pretty special.
LinearSeqstarts by checking