On Thu, Dec 31, 2015, at 12:40 AM, Dave Abrahams wrote:
>> Another motivation for adding this that I forgot to mention is that
>> today the code `someCol.lazy.filter(pred).first` actually isn't lazy
>> at all, it filters the entire collection and builds a new array
>> (because SequenceType doesn't have .first so it resolves the
>> .filter() to the eager version instead of the lazy version).
>
> Oh, that’s nasty.  I wonder if there’s something we can do with
> ambiguity to make the eager overload inaccessible in that context?
> Would you mind opening a bug for this?

Incidentally, I misspoke; the problem is with
`someSeq.lazy.filter(pred).first`. `LazyCollection.filter` returns a
`CollectionType`, so `someCol.lazy.filter(pred).first` works fine there.

-Kevin Ballard
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to