Another use case: I've got a BitArray that makes sense to conform to BitwiseOperations, but it definitely isn't a FixedWidthInteger.<br><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 6, 2016 at 17:56 Max Moiseev via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OptionSets do conform to AlgebraSet but they require raw value type to conform to BitwiseOperations.<br>
<br>
Max<br>
<br>
> On Jul 6, 2016, at 3:44 PM, Jordan Rose <<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>> wrote:<br>
><br>
> Option sets use set notation, not bitwise notation, no?<br>
><br>
> Jordan<br>
><br>
>> On Jul 6, 2016, at 13:28, Max Moiseev via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>> FixedWidthInteger only handles the implementation for the numbers, we should also consider OptionSet.<br>
>><br>
>> I think we should keep the protocol in case someone wants to implement their own type other than an integer to be used as a raw value type in the OptionSet.<br>
>><br>
>> As for renaming it, how about BitwiseOperand?<br>
>><br>
>> protocol BitwiseOperand {<br>
>> func bitwiseOr(_ rhs: Self) -> Self<br>
>> func bitwiseAnd(_ rhs: Self) -> Self<br>
>> // etc ...<br>
>> }<br>
>><br>
>> Max<br>
>><br>
>>> On Jul 1, 2016, at 5:19 PM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>>><br>
>>><br>
>>> on Fri Jul 01 2016, Riley Testut <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>>><br>
>>>> Hi all,<br>
>>>><br>
>>>> This is probably very minor, but I’m not sure the protocol name<br>
>>>> “BitwiseOperations” fits the Swift API Design Guidelines. Here’s what<br>
>>>> the guidelines have to say about protocol names:<br>
>>>><br>
>>>> Protocols that describe what something is should read as nouns (e.g. Collection).<br>
>>>><br>
>>>> Protocols that describe a capability should be named using the<br>
>>>> suffixes able, ible, or ing (e.g. Equatable, ProgressReporting).<br>
>>>><br>
>>>> From these two, BitwiseOperations appears to be (attempting) to follow<br>
>>>> the first rule, yet “BitwiseOperations” doesn’t really describe what<br>
>>>> the type is, but rather that it can do bitwise operations. The<br>
>>>> documentation itself even describes the protocol as “a type that<br>
>>>> supports standard bitwise arithmetic operators."<br>
>>>><br>
>>>> I propose we rename it to “BitwiseOperable”, or something<br>
>>>> similar. Again, a small change, but if this were to ever happen, I<br>
>>>> think Swift 3 is the time.<br>
>>><br>
>>> BitwiseOperations should really be retired after<br>
>>> <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0104-improved-integers.md" rel="noreferrer" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0104-improved-integers.md</a><br>
>>> is implemented, and its uses replaced by FixedWidthInteger.<br>
>>><br>
>>> --<br>
>>> Dave<br>
>>><br>
>>> _______________________________________________<br>
>>> swift-evolution mailing list<br>
>>> <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
>>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
>><br>
>> _______________________________________________<br>
>> swift-evolution mailing list<br>
>> <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
><br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>