<div dir="ltr">On Thu, Aug 17, 2017 at 8:25 PM, Erica Sadun <span dir="ltr">&lt;<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>`repeatElement((), count: 5)` is better than `1 ... 5`, but `Count(3).map({ UIView() })` is far more elegant.  I&#39;d still probably go with an array initializer or `5.elements(of: UIView())`. I don&#39;t think I&#39;m overstating how common this pattern is, and `Array(repeating:count:)` feels _close_ but not close enough.</div></div></blockquote><div><br></div><div>The first two have the benefit of being currently existing APIs; they capture the semantics perfectly, as I&#39;ve argued, and I simply don&#39;t see how they are impaired in elegance in any way--certainly not enough to justify a standard library addition to create a third way of spelling the same thing. Ultimately, any user is free to define something like:</div><div><br></div><div>```</div><div><div>func * &lt;T&gt;(lhs: Int, rhs: @autoclosure () throws -&gt; T) rethrows -&gt; [T] {</div><div>  return try repeatElement((), count: lhs).map { try rhs() }</div><div>}</div><div><br></div><div>5 * UIView()</div></div><div>```</div><div><br></div></div></div></div>