[swift-dev] LazyFilterCollection is not a Collection

2016-05-09 Thread Rob Napier via swift-dev
(Continuing a discussion from https://twitter.com/cocoaphony/status/729712476451971073.) The current recommendation for converting from lazy to strict is with an Array constructor: Array(xs.lazy.) Because the Array constructor accesses count and then iterates over the sequence, this generall

Re: [swift-dev] LazyFilterCollection is not a Collection

2016-05-11 Thread Rob Napier via swift-dev
On Mon, May 9, 2016 at 4:16 PM, Dmitri Gribenko wrote: > On Mon, May 9, 2016 at 11:46 AM, Rob Napier wrote: > > It violates the performance requirements. > > CollectionType.count requires O(1) access if Index is a > > RandomAccessIndexType. > > Hi Rob, > > We don't have RandomAccessIndexType any