[swift-evolution] [swift-evolution-announce] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance
Matthew Johnson
matthew at anandabits.com
Thu Aug 10 15:13:18 CDT 2017
>
> • What is your evaluation of the proposal?
Very large +1 in general. I really wanted to see this happen in Swift 4. I’m very happy that it’s up for review right at the beginning of the Swift 5 process.
That said, I do think the concern others have voiced regarding implicit synthesis has some merit. Most languages I am familiar with that synthesize memberwise implementations do so using an explicit request (`deriving` or similar). It adds a small amount of boilerplate in exchange for precise control. It seems to me that this tradeoff is in line with Swift’s motto of clarity over concision. If we do make a change to this proposal we should also make the same change for basic enums as well as Codable for the sake of consistency.
> • Is the problem being addressed significant enough to warrant a change to Swift?
Yes. Manually writing memberwise implementations is a big enough annoyance that it can influence designs. For example, a library author may be more likely to try and avoid requiring user types to conform when users are required to write those conformances manually.
> • Does this proposal fit well with the feel and direction of Swift?
Very much so.
> • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
It is very similar, although as mentioned, it might make sense to require explicit opt-in to memberwise synthesis.
> • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Quick glance this time around, but I have participated heavily in the previous discussions.
More information about the swift-evolution
mailing list