Re: [swift-evolution] Dictionary Enhancements

2017-02-20 Thread Brent Royal-Gordon via swift-evolution
> On Feb 20, 2017, at 10:19 AM, Ben Cohen wrote: > > As it is right now, that wouldn’t distinguish it since Sequence.filter on > Dictionary can already take a (Key,Value)->Bool transformation since > (Key,Value) is the Element type: > let d = [1:"1"] > let f:

Re: [swift-evolution] Dictionary Enhancements

2017-02-20 Thread Ben Cohen via swift-evolution
Thanks Brent. > On Feb 19, 2017, at 10:37 PM, Brent Royal-Gordon > wrote: > >> On Feb 16, 2017, at 4:26 PM, Ben Cohen via swift-evolution >> wrote: >> >> • init from/merge in a Sequence of Key/Value pairs (already raised as >> SE-100:

Re: [swift-evolution] Dictionary Enhancements

2017-02-19 Thread Brent Royal-Gordon via swift-evolution
> On Feb 16, 2017, at 4:26 PM, Ben Cohen via swift-evolution > wrote: > > • init from/merge in a Sequence of Key/Value pairs (already raised as > SE-100: >

Re: [swift-evolution] Dictionary Enhancements

2017-02-19 Thread Nate Cook via swift-evolution
> On Feb 19, 2017, at 6:13 PM, Ben Cohen via swift-evolution > wrote: > >> On Feb 19, 2017, at 11:22 AM, Ole Begemann > > wrote: >> >>> On 17 Feb 2017, at 01:26, Ben Cohen via swift-evolution >>>

Re: [swift-evolution] Dictionary Enhancements

2017-02-19 Thread Ben Cohen via swift-evolution
> On Feb 19, 2017, at 11:22 AM, Ole Begemann wrote: > > >> On 17 Feb 2017, at 01:26, Ben Cohen via swift-evolution >> > wrote: >> >> Here is a list of commonly requested changes/enhancements to Dictionary, all >> of

Re: [swift-evolution] Dictionary Enhancements

2017-02-19 Thread Ben Cohen via swift-evolution
> On Feb 17, 2017, at 11:20 PM, David Waite > wrote: > > >> On Feb 16, 2017, at 5:26 PM, Ben Cohen via swift-evolution >> > wrote: >> >> Hi swift-evolution, >> >> Following up on Ted’s post regarding

Re: [swift-evolution] Dictionary Enhancements

2017-02-19 Thread Ole Begemann via swift-evolution
> On 17 Feb 2017, at 01:26, Ben Cohen via swift-evolution > wrote: > > Here is a list of commonly requested changes/enhancements to Dictionary, all > of which would probably be appropriate to put together into a single > evolution proposal: > > init from/merge in

Re: [swift-evolution] Dictionary Enhancements

2017-02-19 Thread Jonathan Hull via swift-evolution
>>> Add Dictionary.mapValues to return a Dictionary (can be more efficiently >>> implemented than composition as the storage layout remains the same). >> +1000. I have also been asking for this since the beginning. I built my >> own version (and use it frequently), but as you say, the

Re: [swift-evolution] Dictionary Enhancements

2017-02-17 Thread David Waite via swift-evolution
> On Feb 16, 2017, at 5:26 PM, Ben Cohen via swift-evolution > > wrote: > > Hi swift-evolution, > > Following up on Ted’s post regarding the opening up of stage 2, I’m starting > a thread to discuss improvements to the Dictionary

Re: [swift-evolution] Dictionary Enhancements

2017-02-17 Thread Nate Cook via swift-evolution
Hi Jon, Thank you for the feedback, this is really valuable! A couple questions below. > On Feb 17, 2017, at 8:50 PM, Jonathan Hull via swift-evolution > wrote: > > Thoughts inline. > >> On Feb 16, 2017, at 4:26 PM, Ben Cohen via swift-evolution >>

Re: [swift-evolution] Dictionary Enhancements

2017-02-17 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Feb 17, 2017, at 8:50 PM, Jonathan Hull via swift-evolution > wrote: > > Thoughts inline. > >> On Feb 16, 2017, at 4:26 PM, Ben Cohen via swift-evolution >> wrote: >> >> Hi swift-evolution, >> >> Following up

Re: [swift-evolution] Dictionary Enhancements

2017-02-17 Thread Jonathan Hull via swift-evolution
Thoughts inline. > On Feb 16, 2017, at 4:26 PM, Ben Cohen via swift-evolution > wrote: > > Hi swift-evolution, > > Following up on Ted’s post regarding the opening up of stage 2, I’m starting > a thread to discuss improvements to the Dictionary type. > > Here is a

Re: [swift-evolution] Dictionary Enhancements

2017-02-17 Thread Haravikk via swift-evolution
> On 17 Feb 2017, at 00:26, Ben Cohen via swift-evolution > wrote: > > Hi swift-evolution, > > Add capacity property and reserveCapacity() method. Just wanted to quickly weigh in on this one, but I wonder if this might make most sense coming as a slight

Re: [swift-evolution] Dictionary Enhancements

2017-02-16 Thread David Sweeris via swift-evolution
> On Feb 16, 2017, at 17:45, Ben Cohen wrote: > > >>> On Feb 16, 2017, at 5:38 PM, Slava Pestov wrote: >>> >>> On Feb 16, 2017, at 5:32 PM, David Sweeris via swift-evolution wrote: > On Feb 16,

Re: [swift-evolution] Dictionary Enhancements

2017-02-16 Thread Ben Cohen via swift-evolution
> On Feb 16, 2017, at 5:38 PM, Slava Pestov wrote: > > >> On Feb 16, 2017, at 5:32 PM, David Sweeris via swift-evolution >> > wrote: >> >> >>> On Feb 16, 2017, at 5:17 PM, Ben Cohen >>

Re: [swift-evolution] Dictionary Enhancements

2017-02-16 Thread Slava Pestov via swift-evolution
> On Feb 16, 2017, at 5:32 PM, David Sweeris via swift-evolution > wrote: > > >> On Feb 16, 2017, at 5:17 PM, Ben Cohen > > wrote: >> >> The win with mapping only the values is that the underlying hash table can

Re: [swift-evolution] Dictionary Enhancements

2017-02-16 Thread David Sweeris via swift-evolution
> On Feb 16, 2017, at 5:17 PM, Ben Cohen wrote: > > The win with mapping only the values is that the underlying hash table can > retain the same physical layout, just with different values in the slots, so > it can be done faster. Only if the mapped dictionary’s values

Re: [swift-evolution] Dictionary Enhancements

2017-02-16 Thread Ben Cohen via swift-evolution
> On Feb 16, 2017, at 5:06 PM, David Sweeris wrote: > >> >> On Feb 16, 2017, at 4:26 PM, Ben Cohen via swift-evolution >> > wrote: >> >> Hi swift-evolution, >> >> Following up on Ted’s post regarding the

Re: [swift-evolution] Dictionary Enhancements

2017-02-16 Thread David Sweeris via swift-evolution
> On Feb 16, 2017, at 4:26 PM, Ben Cohen via swift-evolution > wrote: > > Hi swift-evolution, > > Following up on Ted’s post regarding the opening up of stage 2, I’m starting > a thread to discuss improvements to the Dictionary type. > > Here is a list of commonly

[swift-evolution] Dictionary Enhancements

2017-02-16 Thread Ben Cohen via swift-evolution
Hi swift-evolution, Following up on Ted’s post regarding the opening up of stage 2, I’m starting a thread to discuss improvements to the Dictionary type. Here is a list of commonly requested changes/enhancements to Dictionary, all of which would probably be appropriate to put together into a