[swift-evolution] [swift-evolution-announce] [Review] SE-0194: Derived Collection of Enum Cases
stephen.celis at gmail.com
Tue Jan 9 10:06:36 CST 2018
> On Jan 8, 2018, at 2:02 PM, Douglas Gregor <dgregor at apple.com> wrote:
> 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:
> What is your evaluation of the proposal?
I like it. My minor, bike-shed vote is for "allCases": enumerations use the "case" keyword, so it provides nice symmetry.
> Is the problem being addressed significant enough to warrant a change to Swift?
Yes. It's common to write this code manually, and it's uncommon to write code that stays synchronized with the enumeration (especially for non-Int-based).
> Does this proposal fit well with the feel and direction of Swift?
Yes. Swift has been providing more and more useful things for end users by default (deriving Equatable, etc.).
> If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
In Haskell, you can derive "Enum" and "Bounded" for simple sum types and write an "allCases" function that stays in lockstep with the compiler. This is similar to the Int-based workaround mentioned in the proposal. Swift's auto-derivation and -definition would be even simpler.
> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
A quick read.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution