What are use cases to use SeqView
over a Stream
?
scala> List(1,2).view
res34: scala.collection.SeqView[Int,List[Int]] = SeqView(...)
scala> List(1,2).view.toStream
res33: scala.collection.immutable.Stream[Int] = Stream(1, ?)
Perhaps if you need to access the middle of a Stream
and it's costly to access Stream
elements, then you'd use the SeqView
?