<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Is there an implementation in the stdlib for (T?, T?) like this?</div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 6, 2015, at 4:37 PM, Dmitri Gribenko &lt;<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Sun, Dec 6, 2015 at 3:34 PM, Erica Sadun via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">It's pretty easy to build your own Zips. Not sure the language really needs this. For example, I recently built a zip that produces (T?, T?) which fills one of the two with nil until both lists are consumed:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(112,61,170)" class=""><div style="margin:0px;line-height:normal" class=""><span style="color:#bb2ca2" class="">func</span> longZip&lt;S0: SequenceType, S1: SequenceType&gt;(seq0: S0, <span style="color:#bb2ca2" class="">_</span> seq1: S1) -&gt;</div><div style="margin:0px;line-height:normal" class=""><span style="" class="">&nbsp; &nbsp; </span>AnyGenerator<span style="" class="">&lt;(</span>S0<span style="" class="">.</span>Generator<span style="" class="">.</span>Element<span style="" class="">?, </span>S1<span style="" class="">.</span>Generator<span style="" class="">.</span>Element<span style="" class="">?)&gt; {</span></div></div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class=""></div></div><div class="gmail_extra">Just wanted to point out that AnyGenerator has an inherent cost from the type erasure.&nbsp; The implementation in the standard library uses generics and is fully optimizable.</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">Dmitri</div><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">main(i,j){for(i=2;;i++){for(j=2;j&lt;i;j++){if(!(i%j)){j=0;break;}}if<br class="">(j){printf("%d\n",i);}}} /*Dmitri Gribenko &lt;<a href="mailto:gribozavr@gmail.com" target="_blank" class="">gribozavr@gmail.com</a>&gt;*/</div>
</div></div>
</div></blockquote></div><br class=""></body></html>