[swift-evolution] [Re-Review] SE-0104: Protocol-oriented integers

Max Moiseev moiseev at apple.com
Thu Feb 23 17:16:05 CST 2017


> On Feb 23, 2017, at 12:43 PM, David Sweeris <davesweeris at mac.com> wrote:
> 
> 
> 
> 
> Sent from my iPhone
>> On Feb 23, 2017, at 10:40, Max Moiseev <moiseev at apple.com> wrote:
>> 
>> Conformance to Comparable is not required by anything in the standard library.
> 
> That surprises me. Isn't there a sort function or something, or did we change it so they all need a predicate now?
I meant it’s not required from Number.Magnitude. Not in general.

> 
>> I would argue that adding constraints without solid proof of them being useful and necessary is not the right thing to do.
>> Also, sorting things by magnitude will require using a predicate-based sorted() anyway, and that does not require Comparable.
> 
> Yeah, if it's not needed... Well, it's easier to add it later if it turns out to be useful than to remove it if it gets in the way.
> 
> - Dave Sweeris



More information about the swift-evolution mailing list