Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Mike Kluev via swift-evolution
On 25 November 2017 at 23:39, Xiaodi Wu wrote: > On Sat, Nov 25, 2017 at 5:21 PM, Mike Kluev wrote: > >> On 25 November 2017 at 23:07, Xiaodi Wu wrote: >> >>> Not sure what you’re asking. Equatable is a protocol. >>> >> >> that's the point. i mean, if user writes this: >> >> extension (Equatabl

Re: [swift-evolution] Revisiting SE-0132 Rationalizing Sequence end-operation names

2017-11-25 Thread Step Christopher via swift-evolution
I second Xiaodi. The new names are much improved. Land them in 4.1 or as soon as possible. Depreciations in 5 and removal in 6, though stability may not allow removal. > On Nov 2, 2017, at 9:58 PM, Xiaodi Wu via swift-evolution > wrote: > >> On Thu, Nov 2, 2017 at 7:26 PM, Brent Royal-Gordon

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Tony Allevato via swift-evolution
Yeah, I realized that wasn’t true after sending it—it could come from an imported module, as long as it’s visible. Still, I imagine that retroactive conformance wouldn’t be an issue because when the compiler type checks the default at the declaration site, it would only see declarations that it alr

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Xiaodi Wu via swift-evolution
On Sat, Nov 25, 2017 at 5:21 PM, Mike Kluev wrote: > On 25 November 2017 at 23:07, Xiaodi Wu wrote: > >> Not sure what you’re asking. Equatable is a protocol. >> > > that's the point. i mean, if user writes this: > > extension (Equatable, Equatable) : Equatable > > what *else* could he mean othe

Re: [swift-evolution] [Pitch] Generalized supertype constraints

2017-11-25 Thread Dennis Weissmann via swift-evolution
You’re right, I misunderstood that paragraph (maybe I read what I wanted to read :D). Thank you very much for the clarification and I’ll take a closer look at your proposal tomorrow! - Dennis Sent from my iPhone > On 25. Nov 2017, at 10:37 PM, Adrian Zubarev > wrote: > > Well no, this propo

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Mike Kluev via swift-evolution
on Date: Wed, 22 Nov 2017 08:01:16 +0100 David Hart wrote: > > What confuses me is that I always thought that T? was sugar for > Optional by design, and found that to be quite elegant. ditto, i thought the same. > But now you’re telling me that its just a hack to allow conformance on > Option

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Mike Kluev via swift-evolution
On 25 November 2017 at 23:07, Xiaodi Wu wrote: > Not sure what you’re asking. Equatable is a protocol. > that's the point. i mean, if user writes this: extension (Equatable, Equatable) : Equatable what *else* could he mean other than this: extension (T, R) : Equatable and if it is indeed th

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Xiaodi Wu via swift-evolution
On Sat, Nov 25, 2017 at 4:44 PM, Tony Allevato wrote: > On Sat, Nov 25, 2017 at 2:35 PM Xiaodi Wu wrote: > >> On Sat, Nov 25, 2017 at 4:25 PM, Tony Allevato >> wrote: >> >>> On Sat, Nov 25, 2017 at 1:16 PM Xiaodi Wu wrote: >>> On Sat, Nov 25, 2017 at 15:06 Matthew Johnson wrote: >>>

Re: [swift-evolution] [Pitch #2] Introduce User-defined "Dynamic Member Lookup" Types

2017-11-25 Thread Chris Lattner via swift-evolution
On Nov 20, 2017, at 10:36 PM, Chris Lattner wrote: > Hi all, > > I’ve significantly revised the ‘dynamic member lookup’ pitch, here’s the > second edition: > https://gist.github.com/lattner/b016e1cf86c43732c8d82f90e5ae5438 > > I’ve incorporated some minor changes to it: > - I’ve made it possibl

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Xiaodi Wu via swift-evolution
On Sat, Nov 25, 2017 at 16:44 Mike Kluev wrote: > On 25 November 2017 at 22:38, Xiaodi Wu wrote: > >> On Sat, Nov 25, 2017 at 4:30 PM, Mike Kluev wrote: >> >>> i haven't encounter this notation before so it looks strange and >>> requires some effort to decipher. if it was e.g. in this form

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Dave Abrahams via swift-evolution
This sort of “it compiles if it’s syntactically valid, regardless of declared constraints” thing is deliberately avoided in Swift’s generics design with good reason; it’s possible that in this instance there are no problems, but I’m skeptical. Sent from my iPhone > On Nov 25, 2017, at 1:16 PM

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Mike Kluev via swift-evolution
on Date: Thu, 23 Nov 2017 09:56:35 +1100 Howard Lovatt < howard.lov...@gmail.com> wrote: > > I would defend turning tuples into structs (change from structural type to > nominal type). This is a much better story for programmers, compare the two > stories: > >1. Tuples are just syntax sugar fo

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Mike Kluev via swift-evolution
On 25 November 2017 at 22:38, Xiaodi Wu wrote: > On Sat, Nov 25, 2017 at 4:30 PM, Mike Kluev wrote: > >> >>> i haven't encounter this notation before so it looks strange and >> requires some effort to decipher. if it was e.g. in this form: >> >> extension (Equatable...) : Equatable >> >> then it

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Tony Allevato via swift-evolution
On Sat, Nov 25, 2017 at 2:35 PM Xiaodi Wu wrote: > On Sat, Nov 25, 2017 at 4:25 PM, Tony Allevato > wrote: > >> On Sat, Nov 25, 2017 at 1:16 PM Xiaodi Wu wrote: >> >>> On Sat, Nov 25, 2017 at 15:06 Matthew Johnson >>> wrote: >>> On Nov 25, 2017, at 1:28 PM, Tony Allevato via swift-evoluti

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Xiaodi Wu via swift-evolution
On Sat, Nov 25, 2017 at 4:30 PM, Mike Kluev wrote: > On 25 November 2017 at 16:04, Xiaodi Wu wrote: > >> >> The workaround substantially bloats the standard library, and the result >> is nothing close to the same because your type is still not Equatable. This >> means that it cannot benefit from

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Xiaodi Wu via swift-evolution
On Sat, Nov 25, 2017 at 4:25 PM, Tony Allevato wrote: > On Sat, Nov 25, 2017 at 1:16 PM Xiaodi Wu wrote: > >> On Sat, Nov 25, 2017 at 15:06 Matthew Johnson >> wrote: >> >>> On Nov 25, 2017, at 1:28 PM, Tony Allevato via swift-evolution < >>> swift-evolution@swift.org> wrote: >>> >>> On Fri, Nov

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Mike Kluev via swift-evolution
On 25 November 2017 at 16:04, Xiaodi Wu wrote: > > The workaround substantially bloats the standard library, and the result > is nothing close to the same because your type is still not Equatable. This > means that it cannot benefit from any generic algorithms. For example, an > array of such tup

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread David Sweeris via swift-evolution
> On Nov 25, 2017, at 08:05, Xiaodi Wu via swift-evolution > wrote: > > >> On Sat, Nov 25, 2017 at 06:35 Mike Kluev wrote: >>> On 25 November 2017 at 03:12, Xiaodi Wu wrote: >> On Fri, Nov 24, 2017 at 9:08 PM, Mike Kluev via swift-evolution wrote: >>> > On 24 November 2017

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Tony Allevato via swift-evolution
On Sat, Nov 25, 2017 at 1:16 PM Xiaodi Wu wrote: > On Sat, Nov 25, 2017 at 15:06 Matthew Johnson > wrote: > >> On Nov 25, 2017, at 1:28 PM, Tony Allevato via swift-evolution < >> swift-evolution@swift.org> wrote: >> >> On Fri, Nov 24, 2017 at 7:18 PM Xiaodi Wu via swift-evolution < >> swift-evol

Re: [swift-evolution] [Pitch] Generalized supertype constraints

2017-11-25 Thread Adrian Zubarev via swift-evolution
Well no, this proposal won’t allow your example. The problem in your example actually has different roots - *Metatypes*. As by today, meta types are somehow broken, especially in generic / associated type context. Furthermore there is currently no way to express that you may want a subtype for a

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Xiaodi Wu via swift-evolution
On Sat, Nov 25, 2017 at 15:06 Matthew Johnson wrote: > On Nov 25, 2017, at 1:28 PM, Tony Allevato via swift-evolution < > swift-evolution@swift.org> wrote: > > On Fri, Nov 24, 2017 at 7:18 PM Xiaodi Wu via swift-evolution < > swift-evolution@swift.org> wrote: > > > It's kludgy, but we could have

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Thorsten Seitz via swift-evolution
I like Tony's idea. Maybe the default argument functions could even take arguments with earlier parameters from the parameter list. -Thorsten > Am 25.11.2017 um 20:28 schrieb Tony Allevato via swift-evolution > : > >> On Fri, Nov 24, 2017 at 7:18 PM Xiaodi Wu via swift-evolution >> wrote:

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Matthew Johnson via swift-evolution
> On Nov 25, 2017, at 1:28 PM, Tony Allevato via swift-evolution > wrote: > > On Fri, Nov 24, 2017 at 7:18 PM Xiaodi Wu via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > > > > It's kludgy, but we could have something like: > > ``` > @defaultArgument(configuration = (), wher

Re: [swift-evolution] [Pitch] Raw mode string literals

2017-11-25 Thread Thorsten Seitz via swift-evolution
> Am 24.11.2017 um 20:13 schrieb Xiaodi Wu via swift-evolution > : > >> On Thu, Nov 23, 2017 at 5:33 PM, Chris Lattner wrote: >>> On Nov 23, 2017, at 10:35 AM, Xiaodi Wu via swift-evolution >>> wrote: >>> This proposed addition addresses a known pain point, to be sure, but I >>> think it has

Re: [swift-evolution] [Pre-pitch] Conditional default arguments

2017-11-25 Thread Tony Allevato via swift-evolution
On Fri, Nov 24, 2017 at 7:18 PM Xiaodi Wu via swift-evolution < swift-evolution@swift.org> wrote: It's kludgy, but we could have something like: > > ``` > @defaultArgument(configuration = (), where R.Configuration == Void) > @defaultArgument(actionHandler = { _ in }, where R.Action == Never) > fun

Re: [swift-evolution] [Pitch] Raw mode string literals

2017-11-25 Thread Magnus Ahltorp via swift-evolution
> 24 Nov. 2017 08:33 Chris Lattner via swift-evolution > wrote: > > 2) I’d like to explore the idea of making // syntax be *patterns* instead of > simply literals. As a pattern, it should be possible to bind submatches > directly into variable declarations, eliminating the need to count pare

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Xiaodi Wu via swift-evolution
On Sat, Nov 25, 2017 at 06:35 Mike Kluev wrote: > On 25 November 2017 at 03:12, Xiaodi Wu wrote: > >> On Fri, Nov 24, 2017 at 9:08 PM, Mike Kluev via swift-evolution < >> swift-evolution@swift.org> wrote: >> >>> On 24 November 2017 at 23:47, Douglas Gregor wrote: >>> e.g., making all

Re: [swift-evolution] [Pitch] Generalized supertype constraints

2017-11-25 Thread Dennis Weissmann via swift-evolution
I would also love to have generic associated types in the language, I have a lot of uses for them and, IIUC, supertype constraint would enable me to express the following: protocol Service {} protocol WikiService: Service {} // methods not shown for conciseness class DefaultWikiService: WikiSer

Re: [swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

2017-11-25 Thread Mike Kluev via swift-evolution
On 25 November 2017 at 03:12, Xiaodi Wu wrote: > On Fri, Nov 24, 2017 at 9:08 PM, Mike Kluev via swift-evolution < > swift-evolution@swift.org> wrote: > >> On 24 November 2017 at 23:47, Douglas Gregor wrote: >> >>> >>> e.g., making all tuples of Equatable elements Equatable >>> >>> >> that's alr