SE-0280: Enum cases as protocol witnesses

  • What is your evaluation of the proposal?

+ :100:, I think this is a great proposal and feels very natural.

Overall narrowing the gap between structs/classes and enums being able to conform to protocols is fantastic.

  • Is the problem being addressed significant enough to warrant a change to Swift?

Yes, more uniformity across enums/structs in expressive power and conforming to protocols seems important, esp. since enums are so useful and omni-present :slight_smile:

  • Does this proposal fit well with the feel and direction of Swift?

Yes, I think so -- it feels quite natural.

  • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

Nothing quite the same, actually. Even in Scala(3) this can't be expressed as nicely (due to lack of ability to express static functions in traits, as static is not really a thing by itself) as it can be done here, that's pretty nice.

  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

Read through proposal twice and played around with some APIs I'm working with to see if this would be helpful (did not find a killer case yet, but it definitely has potential to clean up certain patterns :heart:)

2 Likes