Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-07-02 Thread Thorsten Seitz via swift-evolution
> Am 25.06.2016 um 22:03 schrieb L. Mihalkovic : > > > > Regards > (From mobile) > >> On Jun 25, 2016, at 8:48 PM, Thorsten Seitz wrote: >> >> >>> Am 25.06.2016 um 19:09 schrieb L. Mihalkovic : >>> >>> >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-25 Thread L. Mihalkovic via swift-evolution
Regards (From mobile) > On Jun 25, 2016, at 8:48 PM, Thorsten Seitz wrote: > > >> Am 25.06.2016 um 19:09 schrieb L. Mihalkovic : >> >> >> >> Regards >> (From mobile) >> >>> On Jun 25, 2016, at 6:34 PM, Thorsten Seitz via swift-evolution

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-25 Thread Thorsten Seitz via swift-evolution
> Am 25.06.2016 um 19:09 schrieb L. Mihalkovic : > > > > Regards > (From mobile) > > On Jun 25, 2016, at 6:34 PM, Thorsten Seitz via swift-evolution > > wrote: > >> Sorry for the late reply — I had

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-25 Thread L. Mihalkovic via swift-evolution
Regards (From mobile) > On Jun 25, 2016, at 6:34 PM, Thorsten Seitz via swift-evolution > wrote: > > Sorry for the late reply — I had hoped to be able to think more deeply about > various points, > but I’m going to delay that instead of delaying the reply even

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-25 Thread Thorsten Seitz via swift-evolution
Sorry for the late reply — I had hoped to be able to think more deeply about various points, but I’m going to delay that instead of delaying the reply even more :-) > Am 17.06.2016 um 19:04 schrieb Dave Abrahams : > > > on Thu Jun 16 2016, Thorsten Seitz wrote: > >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-22 Thread Jonathan Hull via swift-evolution
> On Jun 12, 2016, at 8:31 PM, Dave Abrahams wrote: > > > on Sat Jun 11 2016, Jonathan Hull wrote: > >>> If your code has many manual type erasing wrappers corresponding to >>> protocols with associated types and/or Self requirements that also never >>> have to trap type

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-19 Thread L Mihalkovic via swift-evolution
> On Jun 19, 2016, at 8:35 AM, Douglas Gregor via swift-evolution > wrote: > > > > Sent from my iPhone > > On Jun 18, 2016, at 2:29 AM, Thorsten Seitz > wrote: > >> >>> Am 17.06.2016 um 16:11 schrieb Douglas

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-19 Thread Douglas Gregor via swift-evolution
Sent from my iPhone > On Jun 18, 2016, at 2:29 AM, Thorsten Seitz wrote: > > >>> Am 17.06.2016 um 16:11 schrieb Douglas Gregor : >>> >>> On Jun 16, 2016, at 9:46 AM, Thorsten Seitz via swift-evolution wrote:

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-18 Thread Thorsten Seitz via swift-evolution
> Am 17.06.2016 um 16:11 schrieb Douglas Gregor : > > >> On Jun 16, 2016, at 9:46 AM, Thorsten Seitz via swift-evolution >> > wrote: >> >>> >>> Am 16.06.2016 um 17:36 schrieb Paul Cantrell

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-17 Thread L Mihalkovic via swift-evolution
> On Jun 17, 2016, at 7:04 PM, Dave Abrahams via swift-evolution > wrote: > > > on Thu Jun 16 2016, Thorsten Seitz > wrote: > >>> Am 13.06.2016 um 04:04 schrieb Dave Abrahams : >>> >>> >>> on Fri Jun 10 2016,

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-17 Thread Dave Abrahams via swift-evolution
on Thu Jun 16 2016, Thorsten Seitz wrote: >> Am 13.06.2016 um 04:04 schrieb Dave Abrahams : >> >> >> on Fri Jun 10 2016, Thorsten Seitz wrote: >> Am 09.06.2016 um 19:50 schrieb Thorsten Seitz via swift-evolution : >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-17 Thread Douglas Gregor via swift-evolution
> On Jun 16, 2016, at 9:46 AM, Thorsten Seitz via swift-evolution > wrote: > >> >> Am 16.06.2016 um 17:36 schrieb Paul Cantrell > >: >> >>> On Jun 16, 2016, at 8:29 AM, Thorsten Seitz via swift-evolution >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-16 Thread Thorsten Seitz via swift-evolution
> Am 16.06.2016 um 17:36 schrieb Paul Cantrell : > >> On Jun 16, 2016, at 8:29 AM, Thorsten Seitz via swift-evolution >> > wrote: >> >> Protocols are a mechanism for deriving types from each other whereas >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-16 Thread L. Mihalkovic via swift-evolution
> On Jun 16, 2016, at 5:36 PM, Paul Cantrell via swift-evolution > wrote: > >> On Jun 16, 2016, at 8:29 AM, Thorsten Seitz via swift-evolution >> wrote: >> >> Protocols are a mechanism for deriving types from each other whereas >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-16 Thread Austin Zheng via swift-evolution
> On Jun 16, 2016, at 8:55 AM, Paul Cantrell via swift-evolution > wrote: > > Right. Is that it? Are associated types really just generic protocols + > single conformance constraint + type params inferred / implied? A protocol and its associated types form a

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-16 Thread L. Mihalkovic via swift-evolution
> On Jun 16, 2016, at 3:29 PM, Thorsten Seitz via swift-evolution > wrote: > > > >> Am 13.06.2016 um 04:04 schrieb Dave Abrahams : >> >> >> on Fri Jun 10 2016, Thorsten Seitz wrote: >> Am 09.06.2016 um 19:50 schrieb Thorsten Seitz via

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-16 Thread Paul Cantrell via swift-evolution
> On Jun 16, 2016, at 10:50 AM, Matthew Johnson wrote: > >> >> On Jun 16, 2016, at 10:36 AM, Paul Cantrell via swift-evolution >> > wrote: >> >> This has been a point of confusion for me as well. I keep

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-16 Thread Matthew Johnson via swift-evolution
> On Jun 16, 2016, at 10:36 AM, Paul Cantrell via swift-evolution > wrote: > >> On Jun 16, 2016, at 8:29 AM, Thorsten Seitz via swift-evolution >> > wrote: >> >> Protocols are a mechanism for deriving

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-16 Thread Paul Cantrell via swift-evolution
> On Jun 16, 2016, at 8:29 AM, Thorsten Seitz via swift-evolution > wrote: > > Protocols are a mechanism for deriving types from each other whereas generics > are a way to parameterize types. My point was that Swift's other way to > parameterize types, namely by

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-13 Thread L Mihalkovic via swift-evolution
I had decided to watch from the sideline, but a couple things push me to say something > On Jun 13, 2016, at 4:04 AM, Dave Abrahams via swift-evolution > wrote: > > > on Fri Jun 10 2016, Thorsten Seitz > wrote: > >>> Am 09.06.2016

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-13 Thread Goffredo Marocchi via swift-evolution
Hello Dave, Sent from my iPhone > On 13 Jun 2016, at 03:04, Dave Abrahams via swift-evolution > wrote: > > > on Fri Jun 10 2016, Thorsten Seitz wrote: > >>> Am 09.06.2016 um 19:50 schrieb Thorsten Seitz via swift-evolution >>> : >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-13 Thread Dave Abrahams via swift-evolution
on Sat Jun 11 2016, Jonathan Hull wrote: >> If your code has many manual type erasing wrappers corresponding to >> protocols with associated types and/or Self requirements that also never >> have to trap type mismatches, that would certainly be instructive >> empirical data. Would you care to

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-12 Thread Dave Abrahams via swift-evolution
on Sun Jun 12 2016, L Mihalkovic wrote: > My understanding is that dave is the type system designer. That would be a misunderstanding. I am a contributor, but other people take the lead on the type system. -- Dave ___ swift-evolution mailing list

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-12 Thread Dave Abrahams via swift-evolution
on Fri Jun 10 2016, Thorsten Seitz wrote: >> Am 09.06.2016 um 19:50 schrieb Thorsten Seitz via swift-evolution >> : >> >> >>> Am 09.06.2016 um 18:49 schrieb Dave Abrahams via swift-evolution >>> : >>> > >>> >>> on Wed Jun 08 2016,

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-12 Thread Thorsten Seitz via swift-evolution
> Am 12.06.2016 um 17:40 schrieb L Mihalkovic : > >> >> On Jun 12, 2016, at 4:05 PM, Thorsten Seitz > > wrote: >> >>> >>> Am 12.06.2016 um 09:21 schrieb L. Mihalkovic >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-12 Thread L Mihalkovic via swift-evolution
> On Jun 12, 2016, at 4:05 PM, Thorsten Seitz wrote: > >> >> Am 12.06.2016 um 09:21 schrieb L. Mihalkovic > >: >> >> >> >> >> Regards >> (From mobile) >> On Jun 11, 2016, at 11:43 PM, Thorsten Seitz

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-12 Thread L. Mihalkovic via swift-evolution
> On Jun 12, 2016, at 4:05 PM, Thorsten Seitz wrote: > > >> Am 12.06.2016 um 09:21 schrieb L. Mihalkovic : >> >> >> >> >> Regards >> (From mobile) >> On Jun 11, 2016, at 11:43 PM, Thorsten Seitz wrote: >> >>> >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-12 Thread L. Mihalkovic via swift-evolution
Regards (From mobile) > On Jun 11, 2016, at 11:43 PM, Thorsten Seitz wrote: > > > >> Am 11.06.2016 um 15:08 schrieb L. Mihalkovic : >> >> >>> On Jun 11, 2016, at 2:05 PM, Thorsten Seitz wrote: >>> >>> Am

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Thorsten Seitz via swift-evolution
> Am 11.06.2016 um 15:08 schrieb L. Mihalkovic : > > >> On Jun 11, 2016, at 2:05 PM, Thorsten Seitz wrote: >> >> >>> Am 11.06.2016 um 12:38 schrieb L. Mihalkovic : >>> >>> On Jun 11, 2016, at 11:30 AM,

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Thorsten Seitz via swift-evolution
> Am 11.06.2016 um 14:44 schrieb Matthew Johnson : > > > > Sent from my iPad > >> On Jun 11, 2016, at 7:31 AM, Thorsten Seitz via swift-evolution >> wrote: >> >> Am 11.06.2016 um 14:23 schrieb Brent Royal-Gordon

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread L Mihalkovic via swift-evolution
> On Jun 11, 2016, at 8:46 PM, Brent Royal-Gordon > wrote: > >>> That's certainly a valid question. I have been very vocally skeptical >>> that HKTs like Monad belong in the standard library, but I am not >>> opposed to having the language feature if it supports

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Brent Royal-Gordon via swift-evolution
>> That's certainly a valid question. I have been very vocally skeptical >> that HKTs like Monad belong in the standard library, but I am not >> opposed to having the language feature if it supports important use >> cases. > > It is surprising to see people debating the place of monads in Swift

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread L. Mihalkovic via swift-evolution
>> >> Of course not. The only official plan of record for Swift is approved >> proposals. But it’s always interesting to know the opinions of the >> core team about potential features. Previously my impression had been >> that the general leaning was towards skepticism that the practical >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread L. Mihalkovic via swift-evolution
> On Jun 11, 2016, at 3:03 PM, Matthew Johnson via swift-evolution > wrote: > > > > Sent from my iPad > >> On Jun 10, 2016, at 7:46 PM, Dave Abrahams via swift-evolution >> wrote: >> >> >> on Thu Jun 09 2016, Matthew Johnson >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Matthew Johnson via swift-evolution
Sent from my iPad On Jun 11, 2016, at 7:48 AM, Brent Royal-Gordon wrote: >> Functions and tuples are structural types, although it is probably possible >> to make tuples syntactic sugar for a Tuple type of we get the necessary >> variadic generics support. > > The

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread L. Mihalkovic via swift-evolution
> On Jun 11, 2016, at 2:31 PM, Thorsten Seitz wrote: > > >>> Am 11.06.2016 um 14:23 schrieb Brent Royal-Gordon : >>> >>> The only magic would be that all type definitions (`protocol` etc.) which >>> do not give a supertype they conform to, will

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread L. Mihalkovic via swift-evolution
> On Jun 11, 2016, at 2:05 PM, Thorsten Seitz wrote: > > >> Am 11.06.2016 um 12:38 schrieb L. Mihalkovic : >> >> >>> On Jun 11, 2016, at 11:30 AM, Thorsten Seitz wrote: >>> >>> Am 11.06.2016 um 08:00 schrieb L.

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Jun 10, 2016, at 7:46 PM, Dave Abrahams via swift-evolution > wrote: > > > on Thu Jun 09 2016, Matthew Johnson > wrote: > >>> On Jun 9, 2016, at 3:05 PM, Dave Abrahams >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Brent Royal-Gordon via swift-evolution
> Functions and tuples are structural types, although it is probably possible > to make tuples syntactic sugar for a Tuple type of we get the necessary > variadic generics support. The design the variadic generics thread seems to have preliminarily settled on is based on representing variadic

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Jonathan Hull via swift-evolution
Yikes! I had intended to call rhs._value in ==. Thank you :-) You saved me a lot of debugging time. I ended up fixing with your version. You can see why I would love to have Swift do the thunk-ing for me… less opportunity to shoot myself in the foot with Any. Thanks, Jon > On Jun 11,

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Jun 11, 2016, at 7:31 AM, Thorsten Seitz via swift-evolution > wrote: > > >>> Am 11.06.2016 um 14:23 schrieb Brent Royal-Gordon : >>> >>> The only magic would be that all type definitions (`protocol` etc.) which >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Thorsten Seitz via swift-evolution
> Am 11.06.2016 um 14:23 schrieb Brent Royal-Gordon : > >> The only magic would be that all type definitions (`protocol` etc.) which do >> not give a supertype they conform to, will implicitly conform to `Any`, i.e. >> >> protocol Foo { … } >> >> means >> >> protocol

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Thorsten Seitz via swift-evolution
> Am 11.06.2016 um 13:22 schrieb Jonathan Hull via swift-evolution > : > > Here is another example from a current project: (Here there is an option to > trap, if desired… but many more options not to) > (Note: The commented out bit was an attempt to get the compiler

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Brent Royal-Gordon via swift-evolution
> The only magic would be that all type definitions (`protocol` etc.) which do > not give a supertype they conform to, will implicitly conform to `Any`, i.e. > > protocol Foo { … } > > means > > protocol Foo : Any { … } Any is also the supertype of all structural types, and structural types

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Thorsten Seitz via swift-evolution
> Am 11.06.2016 um 12:38 schrieb L. Mihalkovic : > > >> On Jun 11, 2016, at 11:30 AM, Thorsten Seitz wrote: >> >> >>> Am 11.06.2016 um 08:00 schrieb L. Mihalkovic : >>> >>> >>> >>> >>> Regards >>> (From

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Jonathan Hull via swift-evolution
Here is another example from a current project: (Here there is an option to trap, if desired… but many more options not to) (Note: The commented out bit was an attempt to get the compiler to play nicer with intuiting the type, but it didn’t help… leaving as data) struct HashableBox:Hashable {

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread L. Mihalkovic via swift-evolution
> On Jun 11, 2016, at 11:30 AM, Thorsten Seitz wrote: > > >> Am 11.06.2016 um 08:00 schrieb L. Mihalkovic : >> >> >> >> >> Regards >> (From mobile) >>> On Jun 10, 2016, at 9:35 PM, Thorsten Seitz via swift-evolution >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Jonathan Hull via swift-evolution
> If your code has many manual type erasing wrappers corresponding to > protocols with associated types and/or Self requirements that also never > have to trap type mismatches, that would certainly be instructive > empirical data. Would you care to share the protocols and wrappers you > are

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread Thorsten Seitz via swift-evolution
> Am 11.06.2016 um 08:00 schrieb L. Mihalkovic : > > > > > Regards > (From mobile) >> On Jun 10, 2016, at 9:35 PM, Thorsten Seitz via swift-evolution >> wrote: >> >> >>> Am 09.06.2016 um 19:50 schrieb Thorsten Seitz via

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-11 Thread L. Mihalkovic via swift-evolution
Regards (From mobile) > On Jun 10, 2016, at 9:35 PM, Thorsten Seitz via swift-evolution > wrote: > > >> Am 09.06.2016 um 19:50 schrieb Thorsten Seitz via swift-evolution >> : >> >> >>> Am 09.06.2016 um 18:49 schrieb Dave Abrahams via

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-10 Thread Dave Abrahams via swift-evolution
on Thu Jun 09 2016, Matthew Johnson wrote: >> On Jun 9, 2016, at 3:05 PM, Dave Abrahams >> wrote: >> >> >> on Thu Jun 09 2016, Matthew Johnson wrote: >> > On Jun 9, 2016, at

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-10 Thread Thorsten Seitz via swift-evolution
> Am 09.06.2016 um 19:50 schrieb Thorsten Seitz via swift-evolution > : > > >> Am 09.06.2016 um 18:49 schrieb Dave Abrahams via swift-evolution >> : >> >> >> on Wed Jun 08 2016, Jordan Rose wrote: >> On

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Matthew Johnson via swift-evolution
> On Jun 9, 2016, at 3:05 PM, Dave Abrahams wrote: > > > on Thu Jun 09 2016, Matthew Johnson wrote: > >>> On Jun 9, 2016, at 11:42 AM, Dave Abrahams wrote: >>> >>> >>> on Thu Jun 09 2016, Matthew Johnson >> >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Dave Abrahams via swift-evolution
on Thu Jun 09 2016, Matthew Johnson wrote: >> On Jun 9, 2016, at 11:42 AM, Dave Abrahams wrote: >> >> >> on Thu Jun 09 2016, Matthew Johnson > > wrote: >> > On Jun 9, 2016, at 9:55 AM, Dave Abrahams

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread L Mihalkovic via swift-evolution
> On Jun 9, 2016, at 7:29 PM, Thorsten Seitz via swift-evolution > wrote: > > >> Am 09.06.2016 um 00:18 schrieb Dave Abrahams via swift-evolution >> >: >> >> Exactly. But much simpler cases will also

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread L Mihalkovic via swift-evolution
> On Jun 9, 2016, at 7:50 PM, Thorsten Seitz via swift-evolution > wrote: > > >> Am 09.06.2016 um 18:49 schrieb Dave Abrahams via swift-evolution >> : >> >> >> on Wed Jun 08 2016, Jordan Rose wrote: >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread L Mihalkovic via swift-evolution
> On Jun 9, 2016, at 6:49 PM, Dave Abrahams via swift-evolution > wrote: > > > on Wed Jun 08 2016, Jordan Rose wrote: > >>> On Jun 8, 2016, at 13:16, Dave Abrahams via swift-evolution >>> wrote: >>> >>> >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread L Mihalkovic via swift-evolution
> On Jun 9, 2016, at 4:55 PM, Dave Abrahams via swift-evolution > wrote: > > > on Wed Jun 08 2016, Matthew Johnson > wrote: > >>> On Jun 8, 2016, at 1:33 PM, Dave Abrahams wrote: >>> >>> >>> on Tue Jun 07

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Russ Bishop via swift-evolution
> On Jun 9, 2016, at 9:42 AM, Dave Abrahams via swift-evolution > wrote: > > > If your code has many manual type erasing wrappers corresponding to > protocols with associated types and/or Self requirements that also never > have to trap type mismatches, that would

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Thorsten Seitz via swift-evolution
> Am 09.06.2016 um 19:24 schrieb Austin Zheng via swift-evolution > : > > On Thu, Jun 9, 2016 at 9:42 AM, Dave Abrahams via swift-evolution > > wrote: > > on Thu Jun 09 2016, Matthew Johnson wrote: > > >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Thorsten Seitz via swift-evolution
> Am 09.06.2016 um 18:49 schrieb Dave Abrahams via swift-evolution > : > > > on Wed Jun 08 2016, Jordan Rose wrote: > >>> On Jun 8, 2016, at 13:16, Dave Abrahams via swift-evolution >>> wrote: >>> >>> >>> on

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Thorsten Seitz via swift-evolution
> Am 09.06.2016 um 00:18 schrieb Dave Abrahams via swift-evolution > : > > Exactly. But much simpler cases will also either have to trap at > runtime or be prohibited outright: > > func subscript_(c: C, i: C.Index) -> C.Collection.Element { >return c[i] > } >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Matthew Johnson via swift-evolution
> On Jun 9, 2016, at 11:42 AM, Dave Abrahams wrote: > > > on Thu Jun 09 2016, Matthew Johnson > wrote: > >>> On Jun 9, 2016, at 9:55 AM, Dave Abrahams >> > wrote: >>> >>> >>> on Wed

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Austin Zheng via swift-evolution
On Thu, Jun 9, 2016 at 9:42 AM, Dave Abrahams via swift-evolution < swift-evolution@swift.org> wrote: > > on Thu Jun 09 2016, Matthew Johnson wrote: > > >> > >>> Introducing a language (not library) mechanism that exposes members on > >>> generalized existentials in a way that relies on runtime

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Thorsten Seitz via swift-evolution
> Am 09.06.2016 um 00:13 schrieb Matthew Johnson via swift-evolution > : > > >> On Jun 8, 2016, at 4:47 PM, Austin Zheng > > wrote: >> >> FWIW my opinion is that existentials either shouldn't be allowed to stand

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Dave Abrahams via swift-evolution
on Wed Jun 08 2016, Jordan Rose wrote: >> On Jun 8, 2016, at 13:16, Dave Abrahams via swift-evolution >> wrote: >> >> >> on Wed Jun 08 2016, Thorsten Seitz > >> > > >> wrote:

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Dave Abrahams via swift-evolution
on Thu Jun 09 2016, Matthew Johnson wrote: >> On Jun 9, 2016, at 9:55 AM, Dave Abrahams wrote: >> >> >> on Wed Jun 08 2016, Matthew Johnson > > wrote: >> > On Jun 8, 2016, at 1:33 PM, Dave Abrahams wrote:

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Thorsten Seitz via swift-evolution
> Am 08.06.2016 um 23:37 schrieb Austin Zheng via swift-evolution > : > > func doSomething(x: T, y: T) { > // Get indexes out of x and use them to index into y > var idx = x.startIndex > while (idx != x.endIndex || idx != y.endIndex) { >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Austin Zheng via swift-evolution
Yes, you were correct. Thanks for spotting that and apologies for not acknowledging you sooner. Austin On Thu, Jun 9, 2016 at 1:13 AM, L. Mihalkovic wrote: > > On Jun 9, 2016, at 8:06 AM, Austin Zheng wrote: > > According to that code

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Matthew Johnson via swift-evolution
> On Jun 9, 2016, at 9:55 AM, Dave Abrahams wrote: > > > on Wed Jun 08 2016, Matthew Johnson > wrote: > >>> On Jun 8, 2016, at 1:33 PM, Dave Abrahams wrote: >>> >>> >>> on Tue Jun 07 2016, Matthew Johnson wrote:

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Dave Abrahams via swift-evolution
on Wed Jun 08 2016, Austin Zheng wrote: > On Wed, Jun 8, 2016 at 3:22 PM, Dave Abrahams wrote: > >> >> on Wed Jun 08 2016, Austin Zheng wrote: >> >> > FWIW my opinion is that existentials either shouldn't be allowed to stand >> > in for generic type parameters, or Dave's

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Dave Abrahams via swift-evolution
on Wed Jun 08 2016, Matthew Johnson wrote: >> On Jun 8, 2016, at 1:33 PM, Dave Abrahams wrote: >> >> >> on Tue Jun 07 2016, Matthew Johnson wrote: >> > On Jun 7, 2016, at 9:15 PM, Dave Abrahams wrote: on Tue Jun 07 2016,

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Austin Zheng via swift-evolution
> On Jun 8, 2016, at 11:52 PM, Russ Bishop wrote: > >> >> On Jun 8, 2016, at 3:18 PM, Dave Abrahams via swift-evolution >> > wrote: >> >> Exactly. But much simpler cases will also either have to trap at >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread L. Mihalkovic via swift-evolution
> On Jun 9, 2016, at 8:06 AM, Austin Zheng wrote: > > According to that code (which is in Decl.cpp), AnyObject (and Any) conforms > to itself; no non-@objc protocol is allowed to conform to itself. An @objc > protocol may or may not conform to itself, depending on some

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Russ Bishop via swift-evolution
> On Jun 8, 2016, at 3:18 PM, Dave Abrahams via swift-evolution > wrote: > > Exactly. But much simpler cases will also either have to trap at > runtime or be prohibited outright: > > func subscript_(c: C, i: C.Index) -> C.Collection.Element { >return c[i] > }

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-09 Thread Austin Zheng via swift-evolution
According to that code (which is in Decl.cpp), AnyObject (and Any) conforms to itself; no non-@objc protocol is allowed to conform to itself. An @objc protocol may or may not conform to itself, depending on some other conditions. > On Jun 8, 2016, at 9:19 PM, L. Mihalkovic

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread L. Mihalkovic via swift-evolution
> On Jun 9, 2016, at 12:49 AM, Austin Zheng via swift-evolution > wrote: > > > >> On Wed, Jun 8, 2016 at 3:22 PM, Dave Abrahams wrote: >> >> on Wed Jun 08 2016, Austin Zheng wrote: >> >> > FWIW my opinion is that existentials either

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread L. Mihalkovic via swift-evolution
> On Jun 8, 2016, at 9:43 PM, Austin Zheng via swift-evolution > wrote: > > It's not possible, even with Swift's current implementation of existentials. > A protocol type P isn't considered to conform to itself, thus the following > is rejected: The rules are not

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Austin Zheng via swift-evolution
On Wed, Jun 8, 2016 at 3:22 PM, Dave Abrahams wrote: > > on Wed Jun 08 2016, Austin Zheng wrote: > > > FWIW my opinion is that existentials either shouldn't be allowed to stand > > in for generic type parameters, or Dave's option #1 if they are. > > Don't you mean #2?

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Austin Zheng via swift-evolution
(inline) On Wed, Jun 8, 2016 at 3:18 PM, Dave Abrahams wrote: > > on Wed Jun 08 2016, Austin Zheng wrote: > > > We might be talking past each other. I think Matthew is talking about > using > > an existential outside the context of generic functions. For example, > >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Dave Abrahams via swift-evolution
on Wed Jun 08 2016, Austin Zheng wrote: > FWIW my opinion is that existentials either shouldn't be allowed to stand > in for generic type parameters, or Dave's option #1 if they are. Don't you mean #2? Otherwise I'm confused. #1 is the one that prohibits more usages. > The implied promise

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Dave Abrahams via swift-evolution
on Wed Jun 08 2016, Austin Zheng wrote: > We might be talking past each other. I think Matthew is talking about using > an existential outside the context of generic functions. For example, > something like this should be trap-proof (as long as 'x' is immutable, > which it is in this example):

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Matthew Johnson via swift-evolution
> On Jun 8, 2016, at 4:47 PM, Austin Zheng wrote: > > FWIW my opinion is that existentials either shouldn't be allowed to stand in > for generic type parameters, or Dave's option #1 if they are. > > The implied promise of a generic type parameter T right now is that T

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Matthew Johnson via swift-evolution
> On Jun 8, 2016, at 1:33 PM, Dave Abrahams wrote: > > > on Tue Jun 07 2016, Matthew Johnson wrote: > >>> On Jun 7, 2016, at 9:15 PM, Dave Abrahams wrote: >>> >>> >>> on Tue Jun 07 2016, Matthew Johnson >> >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Dave Abrahams via swift-evolution
on Wed Jun 08 2016, Jordan Rose wrote: >> On Jun 8, 2016, at 13:16, Dave Abrahams via swift-evolution >> wrote: >> >> >> on Wed Jun 08 2016, Thorsten Seitz > > wrote: >> > >>> Ah, thanks, I forgot! I

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Austin Zheng via swift-evolution
FWIW my opinion is that existentials either shouldn't be allowed to stand in for generic type parameters, or Dave's option #1 if they are. The implied promise of a generic type parameter T right now is that T always stands for the same concrete type (modulo things like passing in a subclass where

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Austin Zheng via swift-evolution
We might be talking past each other. I think Matthew is talking about using an existential outside the context of generic functions. For example, something like this should be trap-proof (as long as 'x' is immutable, which it is in this example): func copySequenceIntoArray(x: Any) -> [Int] { var

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Jun 8, 2016, at 3:16 PM, Dave Abrahams via swift-evolution > wrote: > > >> on Wed Jun 08 2016, Thorsten Seitz wrote: >> >> Ah, thanks, I forgot! I still consider this a bug, though (will have >> to read up again

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Jordan Rose via swift-evolution
> On Jun 8, 2016, at 13:16, Dave Abrahams via swift-evolution > wrote: > > > on Wed Jun 08 2016, Thorsten Seitz > wrote: > >> Ah, thanks, I forgot! I still consider this a bug, though (will have >> to

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Dave Abrahams via swift-evolution
on Wed Jun 08 2016, Thorsten Seitz wrote: > Ah, thanks, I forgot! I still consider this a bug, though (will have > to read up again what the reasons are for that behavior). Yes, but in the case of the issue we're discussing, the choices are: 1. Omit from the

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Thorsten Seitz via swift-evolution
Ah, thanks, I forgot! I still consider this a bug, though (will have to read up again what the reasons are for that behavior). -Thorsten > Am 08.06.2016 um 21:43 schrieb Austin Zheng : > > It's not possible, even with Swift's current implementation of existentials. >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Austin Zheng via swift-evolution
It's not possible, even with Swift's current implementation of existentials. A protocol type P isn't considered to conform to itself, thus the following is rejected: let a : MyProtocol = // ... func myFunc(x: T) { // } myFunc(a) // "Cannot invoke 'myFunc' with an argument list of type

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Thorsten Seitz via swift-evolution
> Am 08.06.2016 um 20:33 schrieb Dave Abrahams via swift-evolution > : > > > on Tue Jun 07 2016, Matthew Johnson wrote: > >>> On Jun 7, 2016, at 9:15 PM, Dave Abrahams wrote: >>> >>> >>> on Tue Jun 07 2016, Matthew Johnson >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Dave Abrahams via swift-evolution
on Tue Jun 07 2016, Matthew Johnson wrote: >> On Jun 7, 2016, at 9:15 PM, Dave Abrahams wrote: >> >> >> on Tue Jun 07 2016, Matthew Johnson > > wrote: >> > On Jun 7, 2016, at 4:13 PM, Dave Abrahams via swift-evolution

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-08 Thread Matthew Johnson via swift-evolution
> On Jun 7, 2016, at 9:27 PM, Matthew Johnson wrote: > >> >> On Jun 7, 2016, at 9:15 PM, Dave Abrahams > > wrote: >> >> >> on Tue Jun 07 2016, Matthew Johnson > > wrote: >> On

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-07 Thread Matthew Johnson via swift-evolution
> On Jun 7, 2016, at 9:15 PM, Dave Abrahams wrote: > > > on Tue Jun 07 2016, Matthew Johnson > wrote: > >>> On Jun 7, 2016, at 4:13 PM, Dave Abrahams via swift-evolution >>> wrote: >>> >>> >>> on Tue Jun

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-07 Thread Matthew Johnson via swift-evolution
> On Jun 7, 2016, at 4:13 PM, Dave Abrahams via swift-evolution > wrote: > > > on Tue Jun 07 2016, Matthew Johnson wrote: > >>> , but haven't realized >>> that if you step around the type relationships encoded in Self >>> requirements

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-07 Thread Dave Abrahams via swift-evolution
on Tue Jun 07 2016, Matthew Johnson wrote: >> , but haven't realized >> that if you step around the type relationships encoded in Self >> requirements and associated types you end up with types that appear to >> interoperate but in fact trap at runtime unless used in

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-07 Thread L Mihalkovic via swift-evolution
> On Jun 7, 2016, at 7:51 PM, Dave Abrahams via swift-evolution > wrote: > > > on Tue Jun 07 2016, Matthew Johnson wrote: > >>> On Jun 6, 2016, at 12:22 AM, Dave Abrahams >> wrote: >>> >>> >>> on Sun Jun 05 2016, Matthew Johnson >

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

2016-06-07 Thread Matthew Johnson via swift-evolution
> On Jun 7, 2016, at 12:51 PM, Dave Abrahams wrote: > > > on Tue Jun 07 2016, Matthew Johnson wrote: > >>> On Jun 6, 2016, at 12:22 AM, Dave Abrahams >> wrote: >>> >>> >>> on Sun Jun 05 2016, Matthew Johnson > >

  1   2   >