[swift-evolution] [Review] SE-0032: Add find method to SequenceType

Maksim Odnoletkov odnoletkov at mail.ru
Thu Apr 28 20:55:43 CDT 2016


I feel like the real problem is not SequenceType.find missing but
SequenceType.first which is much more general and useful.
CollectionType.first should be generalized to SequenceType.first. This will
fix seq.lazy.filter(predicate).first. And I don't feel it deserves a
separate find method.

On a side note this proposal highlights another problem: array-returning
versions of SequenceType.map/flatMap/filter are often unexpectedly used
instead of lazy variants
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160429/8ac1c19d/attachment.html>

More information about the swift-evolution mailing list