[swift-users] Collection underestimatedCount() does _?

Fritz Anderson fritza at manoverboard.org
Sat Mar 19 11:52:05 CDT 2016


On Mar 19, 2016, at 1:08 AM, Dmitri Gribenko via swift-users <swift-users at swift.org> wrote:
> 
> This API comes from Sequence, which does not have a count that you can
> inspect without possibly consuming the sequence.

Am I right that notionally-infinite sequences (like bytes from a random-number generator) should report Int.max (making friends with zip(_:,_;) and laziness), or am I advised not to use Sequence semantics for those at all?

(Contemplating protocol InfiniteSequence, but not asking for it as a future.)

    — F


More information about the swift-users mailing list