I would like a List
, Seq
, or even an Iterable
that is a read-only view of a part of a List, in my specific case, the view will always start at the first element.
List.slice
, is O(n) as is filter
. Is there anyway of doing better than this - I don't need any operations like +
, -
etc. Just apply
, map
, flatMap
, etc to provide for list comprehension syntax on the sub list.
Is the answer to write my own class whose iterators keep a count to know where the end is?