<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><blockquote type="cite" class=""><div class="">On May 1, 2017, at 8:29 PM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Heck, we don't even have left padding for strings!</span></div></blockquote><br class=""></div><div>For what it's worth, a good Swift implementation of left-padding would probably *use* `repeatElement`:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>extension String {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mutating&nbsp;func leftPad(to intendedCount: Int, with char: Character = " ") {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>let extraCount = max(intendedCount - count, 0)</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>let extras = repeatElement(char, count: extraCount)</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>insert(contentsOf: extras, at: startIndex)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br class=""></div><div>And, for that matter, `repeatElement` could be used to implement "repeat this collection":</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>repeatElement(c, count: n).joined()</div><div class=""><br class=""></div><div class="">So I agree with you, Xiaodi, that there's no rush to do this. If we change our minds later, we can always turn `Repeated&lt;T&gt;` into a generic typealias for `RepeatedCollection&lt;CollectionOfOne&lt;T&gt;&gt;`.</div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; border-spacing: 0px;"><div class=""><div style="font-size: 12px; " class="">--&nbsp;</div><div style="font-size: 12px; " class="">Brent Royal-Gordon</div><div style="font-size: 12px; " class="">Architechies</div></div></span>

</div>
<br class=""></body></html>