[swift-evolution] [Pitch] Add an all algorithm to Sequence

Robert Bennett rltbennett at icloud.com
Fri Mar 31 18:20:02 CDT 2017


Sorry, despite the curt tone of my initial post, I think this is overall a great idea. Ben, thanks for drafting the proposal.

> On Mar 31, 2017, at 6:12 PM, Ricardo Parada <rparada at mac.com> wrote:
> 
> I agree. 
> 
>> On Mar 31, 2017, at 5:32 PM, Robert Bennett via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> I'm don't think we need all(equal:).
>> 1) For a host of reasons, having a single signature for a function name is better than having multiple signatures when the single signature is capable enough.
>> 2) A list containing a single distinct element is not a special enough case to check for to warrant its own function signature.
>> 
>> all(equal:) can be replicated easily enough with nums.all { $0 == 9 }. Unlike all(equals:), this is extendible to non-Equatable types with equatable members.
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list