<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>I’m overall +1, but I’m curious: would you be able to conform an enum from another module to ValueEnumerable via an extension, <i>and</i> still have the compiler generate the protocol requirements for you? I can imagine that the client of a framework with an enum may have a valid use for iterating over all values that the author didn’t foresee, and I would very much like the client to be able to opt-in to the compiler code generation.</div><div><br></div><div>(Personally, I’d prefer that <i>all</i> simple enums automatically conform to the protocol and have automatic implementations, since I don’t really see a downside to this that exists for some other compiler-magic protocols like Codable)</div><div><br>On Jan 9, 2018, at 8:45 AM, Tony Allevato via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Jan 8, 2018 at 11:02 AM Douglas Gregor via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><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"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Hello Swift community,</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">The review of SE-0194 "Derived Collection of Enum Cases" begins now and runs through January 11, 2018. The proposal is available here:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><font color="#6a737d" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md</a></font></div></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="nofollow" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);background-color:rgb(255,255,255)"><p style="color:rgb(106,115,125);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;box-sizing:border-box;margin-top:0px;margin-bottom:16px">Proposal link:</p><blockquote style="box-sizing:border-box;margin:0px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><font color="#6a737d" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md</a></font></div></blockquote></blockquote><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">Reply text</div></blockquote><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><blockquote style="box-sizing:border-box;margin:0px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">Other replies</div></blockquote></blockquote><h5 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:0.875em;line-height:1.25;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;background-color:rgb(255,255,255)"><a href="https://github.com/apple/swift-evolution/pull/114#what-goes-into-a-review-1" class="m_7892790042685077186anchor" id="m_7892790042685077186user-content-what-goes-into-a-review-1" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"><u></u><u></u><u></u><u></u></a>What goes into a review?</h5><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><li style="box-sizing:border-box">What is your evaluation of the proposal?</li></ul></div></blockquote><div>Big&nbsp;+1. I've been looking forward to something like this for a long time.</div><div><br></div><div>I'm extremely happy with the API chosen here. ValueEnumerable and allValues are absolutely the correct names, because the protocol is not *restricted* to enums, it is merely *synthesized automatically* for enums. That's a very important distinction. Someone could provide their own conformance to ValueEnumerable and use it in generic algorithms and have everything work as expected.</div><div><br></div><div>In a perfect world I would argue that the associated type of allValues should be a Sequence instead of a Collection as this would allow it to be extended to infinite sequences (i.e., cases with associated values that are deeply ValueEnumerable), but I'll admit that I've never come up with a compelling use case for this beyond obscure combinatorial algorithms. Since getting the count of values is important to many users, Collection is a reasonable compromise and I don't have any objections.</div><div>&nbsp;<br></div><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"><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><li style="box-sizing:border-box;margin-top:0.25em">Is the problem being addressed significant enough to warrant a change to Swift?</li></ul></div></blockquote><div>Yes. It's a frequently requested feature and has utility both in UI-driven logic (table view sections based on an enum) and other algorithms.</div><div><br></div><div>&nbsp;</div><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"><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><li style="box-sizing:border-box;margin-top:0.25em">Does this proposal fit well with the feel and direction of Swift?</li></ul></div></blockquote><div>Yes. The API design fits right into other stdlib concepts, and the conditions for synthesis align with the synthesis of other synthesized protocols.</div><div><br></div><div>&nbsp;</div><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"><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><li style="box-sizing:border-box;margin-top:0.25em">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</li></ul></div></blockquote><div>Just Java's values() function that is present on all enums. The functionality provided here is what I would expect, similar to other languages.</div><div><br></div><div>&nbsp;</div><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"><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><li style="box-sizing:border-box;margin-top:0.25em">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</li></ul></div></blockquote><div>An in-depth read and I was heavily involved in some of the earlier discussion threads.</div><div><br></div><div>&nbsp;</div><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"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">More information about the Swift evolution process is available at</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><a href="https://github.com/apple/swift-evolution/blob/master/process.md" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none" target="_blank">https://github.com/apple/swift-evolution/blob/master/process.md</a></div></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Thank you,</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">-Doug Gregor</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Review Manager</p></div>_______________________________________________<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></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>