<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I agree that if “contains” has its place in the standard library, so does “all”</div><div class=""><br class=""></div><div class="">I also regularly use the extension</div><div class=""><br class=""></div><div class="">func forAll(suchThat predicate: (Element) -> Bool) -> Bool</div><div class=""><br class=""></div><div class="">which I use like so</div><div class=""><br class=""></div><div class="">[0,1,2,3,4].forAll(suchThat: isEven)</div><div class=""><br class=""></div><div class="">[0,1,2,3,4].forAll { $0 < 5}</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 1 Apr 2017, at 19:58, Nevin Brackett-Rozinsky via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra">If indeed “all(equal:)” is rarely needed, then perhaps it is best to leave it out *and also* leave out the argument label from “all(matching:)”. Then the signature would be similar to,</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><font face="monospace, monospace" class="">func all(_ predicate: (Element)->Bool) -> Bool</font></div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">and the points-of-use would look like:</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><font face="monospace, monospace" class="">nums.all( isEven )</font></div><div class="gmail_extra"><font face="monospace, monospace" class="">nums.all{ $0 == 9 }</font></div><div class="gmail_extra"><font face="monospace, monospace" class="">nums.all{ n in n*n < 2 }</font></div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">Nevin</div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>