<div dir="ltr">Re-reading this thread and thinking about it more, I think I agree :)  Updating again...<div class="gmail_extra">
<br><div class="gmail_quote">On Sat, Dec 30, 2017 at 3:44 PM, Chris Lattner <span dir="ltr">&lt;<a href="mailto:clattner@nondot.org" target="_blank">clattner@nondot.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="">On Dec 30, 2017, at 3:12 PM, Jacob Bandes-Storch via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br></span><div><span class=""><blockquote type="cite">Sorry for the delay. I&#39;ve just updated the proposal text to incorporate various changes, some contributed by others.<br><div><div dir="ltr"><div><br></div><a href="https://github.com/jtbandes/swift-evolution/blob/case-enumerable/proposals/0000-derived-collection-of-enum-cases.md" target="_blank">https://github.com/jtbandes/<wbr>swift-evolution/blob/case-<wbr>enumerable/proposals/0000-<wbr>derived-collection-of-enum-<wbr>cases.md</a></div></div></blockquote><div><br></div></span><div>I would really love to see this happen.  I did a pass over the proposal, I strong suggest that you get Joe Groff’s input on this, because he has some opinions as well.</div><div><br></div><div>IMO, the proposal looks really great except for one thing:   In &quot;proposed solution”, I think it is very important that conformance to ValueEnumerable be explicitly requested in the code.  Specifically:</div><div><br></div><div>enum Ma { case 马, 吗, 妈, 码, 骂, <wbr>麻, 🐎, 🐴 }<br>Ma.allValues   // error.</div><div><br></div><div><div>enum Ma : ValueEnumerable { case 马, 吗, 妈, 码, 骂, 麻, 🐎, 🐴 }<br>Ma.allValues   // works!</div><div><br></div><br></div><div>This is for two reasons:</div><div>1) Consistency with other similar features in Swift.  Types are not hashable just because their members could be.  This is because we want people to think about and explicitly opt into API features like this.</div><div>2) To align with our resilience design.  An enum with no value-associated cases today could acquire them in the future, and doing so would implicitly remove this conformance.  This would be surprising and bad.</div><div><br></div><div>Thanks for pushing this forward!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Chris</div></font></span><span class=""><div><br></div><div><br></div><div><br></div><div><br></div><br><br><blockquote type="cite"><div><div dir="ltr">Robert&#39;s <a href="https://github.com/apple/swift-evolution/pull/114#issuecomment-337105126" target="_blank">implementation</a> is a good start, but will need to be updated to match the naming choice in the final proposal, and to use associatedtype.<div><div class="gmail_extra">
<br><div class="gmail_quote">On Fri, Dec 8, 2017 at 9:19 PM, Step Christopher <span dir="ltr">&lt;<a href="mailto:schristopher@bignerdranch.com" target="_blank">schristopher@bignerdranch.com</a><wbr>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div></div><div>Has this stalled out again? I would like to help with the proposal and even attempt implementation. </div><div><br></div><div>I also need to catch up on the resilient discussion regarding enum case ordering. </div><div><div class="m_-6449586908531046646h5"><div><br>On Nov 14, 2017, at 10:50 PM, Jacob Bandes-Storch via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br clear="all"><div><div class="m_-6449586908531046646m_6284411688378109394gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Jacob Bandes-Storch<br></div></div></div></div>
<br><div class="gmail_quote">On Tue, Nov 14, 2017 at 9:06 PM, Brent Royal-Gordon <span dir="ltr">&lt;<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><span><blockquote type="cite"><div>On Nov 14, 2017, at 5:21 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_-6449586908531046646m_6284411688378109394m_40430440677206812Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><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;line-break:after-white-space"><div>1. It must be possible to easily access the count of values, and to access any particular value using contiguous `Int` indices. This could be achieved either by directly accessing elements in the list of values through an Int subscript, or by constructing an Array from the list of values.</div><div><br></div><div>2. It must be possible to control the order of values in the list of values, either by using source order or through some other simple, straightforward mechanism.</div></div></blockquote><div> </div><div>OK, first of all, nowhere in the proposal text are these requirements stated as part of the use case. You&#39;re free to put forward new use cases, but here I am trying to design the most elegant way to fulfill a stated need and you&#39;re telling me that it&#39;s something other than what&#39;s written.</div></div></div></div></div></blockquote><div><br></div></span><div>Honestly, re-reading the proposal, it never cites a fully-formed use case. Instead, it cites several blog posts, Stack Overflow questions, and small code samples without digging in to the underlying reasons why developers are doing what they&#39;re doing. Most of the people discussing it so far seem to have had a tacit understanding that we wanted roughly Array-like access, but we haven&#39;t explicitly dug into which properties of an Array are important.</div><div><br></div><div>(If anyone involved feels like they had a different understanding of the use case, please speak up.)</div><div><br></div><div>I think this is a place where the proposal can be improved, and I&#39;m willing to do some writing to improve it.</div></div></div></blockquote><div><br></div><div>For the record, I would be happy to add co-authors (or even relinquish authorship entirely—I don&#39;t really care whose name is on this, it just needs to happen!) if you or anyone else has improved wording, motivation, justification, etc. to contribute.</div></div></div></div>
</div></blockquote></div></div><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a></span><br></span></div></blockquote></div></blockquote></div><br></div></div></div>
______________________________<wbr>_________________<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" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></div></blockquote></span></div><br></div></blockquote></div><br></div></div>