Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-11 Thread Ben Rimmington via swift-evolution
## What is your evaluation of the proposal? ## +1 When `Codable` can be synthesized in a same-file extension, the same should hopefully be possible with `Equatable` and `Hashable`. "W

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-11 Thread Haravikk via swift-evolution
> On 10 Aug 2017, at 23:29, Brent Royal-Gordon wrote: > > If the only difference were whether the default implementation was generated > by a macro or not, would you still think auto-derivation should be marked > with a keyword? Yes. With or without a macro the issue here is still that the s

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Jordan Rose via swift-evolution
> On Aug 10, 2017, at 15:34, Tony Allevato wrote: > > Do you mean something like this, then? > > ``` > struct Foo: Equatable { > let x: Int > } > > func test(_ lhs: T, _ rhs: T) -> Bool { > return lhs == rhs > } > > extension Foo { > static func == (lhs: Foo, rhs: Foo) -> Bool { >

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Tony Allevato via swift-evolution
Do you mean something like this, then? ``` struct Foo: Equatable { let x: Int } func test(_ lhs: T, _ rhs: T) -> Bool { return lhs == rhs } extension Foo { static func == (lhs: Foo, rhs: Foo) -> Bool { return lhs.x % 2 == rhs.x % 2 } } print(test(Foo(x: 5), Foo(x: 7))) // true ```

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Brent Royal-Gordon via swift-evolution
> On Aug 10, 2017, at 3:40 AM, Haravikk via swift-evolution > wrote: > > This is not the same as a default protocol implementation Actually, I could easily imagine that a future version of Swift with macro support might do this with a default protocol implementation: extension Equatab

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Jordan Rose via swift-evolution
> On Aug 10, 2017, at 14:48, Tony Allevato wrote: > > On Thu, Aug 10, 2017 at 11:05 AM Jordan Rose > wrote: > [Proposal: > https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md > >

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Tony Allevato via swift-evolution
On Thu, Aug 10, 2017 at 11:05 AM Jordan Rose wrote: > [Proposal: > https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md > ] > > Hi, Tony. Glad to see this back again! > > Overall I'm an enthusiastic +1. The restrictions and future work you've > list

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Jordan Rose via swift-evolution
[Proposal: https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md ] Hi, Tony. Glad to see this back again! Overall I'm an enthusiastic +1. The res

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Shawn Erickson via swift-evolution
> My hunch is that structs and enums where such volatile data exists are the > exception, not the norm, when it comes to considering equality. This > proposal is very much intended to be useful syntactic sugar for the common > case while not preventing any existing behavior (providing your own > im

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Tony Allevato via swift-evolution
On Thu, Aug 10, 2017 at 3:40 AM Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > > On 10 Aug 2017, at 10:32, Martin Waitz wrote: > > Hi Haravikk, > > Am 2017-08-10 11:07, schrieb Haravikk via swift-evolution: > > I don't feel that conforming to > Equatable/Hashable is sufficient

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Elviro Rocca via swift-evolution
Huge +1 This should have been there from Swift 1, and basically forced me to use Sourcery to automatically generate all that code. Elviro > Il giorno 10 ago 2017, alle ore 01:09, Chris Lattner via swift-evolution > ha scritto: > > Hello Swift community, > > The review of SE-0185 - "Synthes

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Haravikk via swift-evolution
> On 10 Aug 2017, at 10:32, Martin Waitz wrote: > > Hi Haravikk, > > Am 2017-08-10 11:07, schrieb Haravikk via swift-evolution: >> I don't feel that conforming to >> Equatable/Hashable is sufficient as an opt-in. Consider for example >> someone who declares their type as Equatable/Hashable, the

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Martin Waitz via swift-evolution
Hi Haravikk, Am 2017-08-10 11:07, schrieb Haravikk via swift-evolution: I don't feel that conforming to Equatable/Hashable is sufficient as an opt-in. Consider for example someone who declares their type as Equatable/Hashable, then sets to work on the details of their type, forgetting to impleme

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-10 Thread Haravikk via swift-evolution
> On 10 Aug 2017, at 00:08, Chris Lattner via swift-evolution > wrote: > > • What is your evaluation of the proposal? Generally positive, but I don't feel that conforming to Equatable/Hashable is sufficient as an opt-in. Consider for example someone who declares their type as Equatable

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-09 Thread Tony Allevato via swift-evolution
On Wed, Aug 9, 2017 at 4:36 PM Xiaodi Wu via swift-evolution < swift-evolution@swift.org> wrote: > On Wed, Aug 9, 2017 at 6:08 PM, Chris Lattner via swift-evolution < > swift-evolution@swift.org> wrote: > >> Hello Swift community, >> >> The review of SE-0185 - "Synthesizing Equatable and Hashable

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-09 Thread Xiaodi Wu via swift-evolution
On Wed, Aug 9, 2017 at 6:08 PM, Chris Lattner via swift-evolution < swift-evolution@swift.org> wrote: > Hello Swift community, > > The review of SE-0185 - "Synthesizing Equatable and Hashable conformance" > begins now and runs through August 15, 2017. The proposal is available here: > https://gith

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-09 Thread Jon Shier via swift-evolution
> • What is your evaluation of the proposal? +∞ - 1 (for no extension synthesis) > • Is the problem being addressed significant enough to warrant a change to > Swift? Most certainly. This is a major pain point, especially for structs with many members. > • Does this proposal fit well with the

Re: [swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-09 Thread Chris Lattner via swift-evolution
I forgot to mention that the implementation of this feature is available here: https://github.com/apple/swift/pull/9619 -Chris > On Aug 9, 2017, at 4:08 PM, Chris Lattner wrote: > > Hello Swift community, > > The review of SE-0185 - "Synthesizing Equatable and Hashable conformance" > begins n

[swift-evolution] [Review] SE-0185 - Synthesizing Equatable and Hashable conformance

2017-08-09 Thread Chris Lattner via swift-evolution
Hello Swift community, The review of SE-0185 - "Synthesizing Equatable and Hashable conformance" begins now and runs through August 15, 2017. The proposal is available here: https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md Reviews are an impor