Re: [swift-evolution] Pattern matching with Arrays

2017-01-17 Thread Joseph Newton via swift-evolution
+1 I've had many a use case for this and would benefit from it being added. > On Jan 17, 2017, at 10:39, Mathew Sanders via swift-evolution > wrote: > > Great to hear that more pattern matching is likely in the Swift's future, and > whatever form it takes I'm

Re: [swift-evolution] Pattern matching with Arrays

2017-01-17 Thread Mathew Sanders via swift-evolution
Great to hear that more pattern matching is likely in the Swift's future, and whatever form it takes I'm looking forward to it :) Do you think it would make sense to make this an official part of > swift-evolution? Perhaps an analog to the “commonly rejected” list? >

Re: [swift-evolution] Pattern matching with Arrays

2017-01-16 Thread Chris Lattner via swift-evolution
> On Jan 16, 2017, at 9:53 PM, Jay Abbott via swift-evolution > wrote: > > Regarding the "some-day" list (or "deferred" proposals): It has been > discussed many times before, and Chris also agreed that it would be > useful[1], but nobody seems to have made it

Re: [swift-evolution] Pattern matching with Arrays

2017-01-15 Thread Jacob Bandes-Storch via swift-evolution
On Tue, Jan 3, 2017 at 10:10 AM, Joe Groff via swift-evolution < swift-evolution@swift.org> wrote: > > On Dec 22, 2016, at 7:43 PM, Robert Widmann > wrote: > > Do you think there’s room for a more general Pattern Synonyms-like >

Re: [swift-evolution] Pattern matching with Arrays

2017-01-03 Thread Joe Groff via swift-evolution
> On Dec 22, 2016, at 7:43 PM, Robert Widmann wrote: > > Do you think there’s room for a more general Pattern Synonyms-like > feature that could > extend this to things that look tuple-y? We had a short

Re: [swift-evolution] Pattern matching with Arrays

2016-12-22 Thread Georgios Moschovitis via swift-evolution
> Yeah, this is something I've wanted to add for a while, along with pattern > matching for dictionaries, which together with array matching I think would > make a lot of JSON/plist wrangling much more pleasant. +1 ___ swift-evolution mailing list

Re: [swift-evolution] Pattern matching with Arrays

2016-12-22 Thread David Sweeris via swift-evolution
> On Dec 17, 2016, at 9:43 PM, Mathew Sanders via swift-evolution > wrote: > > I've just joined the list (hi!) so not sure if this has been discussed in the > past. > > Curious to hear if a future version of Swift might ever include some sort of > pattern-matching

Re: [swift-evolution] Pattern matching with Arrays

2016-12-22 Thread Erica Sadun via swift-evolution
On Dec 22, 2016, at 8:43 PM, Robert Widmann via swift-evolution wrote: > > Do you think there’s room for a more general Pattern Synonyms-like > feature that could > extend this to things that look tuple-y? We

Re: [swift-evolution] Pattern matching with Arrays

2016-12-22 Thread Robert Widmann via swift-evolution
Do you think there’s room for a more general Pattern Synonyms-like feature that could extend this to things that look tuple-y? We had a short conversation on Twitter 'round about the release of Swift 1.2 about Swiftz’s HList

Re: [swift-evolution] Pattern matching with Arrays

2016-12-22 Thread Joe Groff via swift-evolution
> On Dec 17, 2016, at 9:43 PM, Mathew Sanders via swift-evolution > wrote: > > I've just joined the list (hi!) so not sure if this has been discussed in the > past. > > Curious to hear if a future version of Swift might ever include some sort of > pattern-matching

Re: [swift-evolution] Pattern matching with Arrays

2016-12-19 Thread Anton Zhilin via swift-evolution
2016-12-19 3:09 GMT+03:00 Lucas Neiva via swift-evolution < swift-evolution@swift.org>: > case let [first, next...]: > > case let [first, last]: > > The binding should be more like "[let first, let last]" though, to be more > like the tuple matching. For the above also: "case [let head, let

Re: [swift-evolution] Pattern matching with Arrays

2016-12-18 Thread Lucas Neiva via swift-evolution
As a fellow functional programming aficionado, I'd like this very much, too. From lurking here, I think something like this is of low priority at the moment since it is and additive feature. Especially head/tail matching looks very interesting. I also like the syntax you suggest here: > case

[swift-evolution] Pattern matching with Arrays

2016-12-17 Thread Mathew Sanders via swift-evolution
I've just joined the list (hi!) so not sure if this has been discussed in the past. Curious to hear if a future version of Swift might ever include some sort of pattern-matching extended to Arrays. Maybe something like the following: let numbers: [Int] switch numbers { case []: // to