Re: [swift-evolution] [Pitch] Synthesized static enum property to iterate over cases

2017-09-08 Thread Logan Shire via swift-evolution
Hey folks! Thanks for all the great feedback and discussion. I really like Tony's suggestion of the opt-in ValueEnumerable protocol. However, I think Kevin is right that it should be a simple array. If we wanted to get fancy, we could implement a custom integer indexed collection that indexed

Re: [swift-evolution] [Pitch] Improving KeyPath

2017-08-25 Thread Logan Shire via swift-evolution
ug 23, 2017, at 11:18 PM, Logan Shire via swift-evolution < > swift-evolution@swift.org> wrote: > > > > Hey folks! > > > > Recently I’ve been working on a small library which leverages the Swift > 4 Codable protocol > > and KeyPaths to provide a Swift-y inte

[swift-evolution] [Pitch] Improving KeyPath

2017-08-24 Thread Logan Shire via swift-evolution
Hey folks! Recently I’ve been working on a small library which leverages the Swift 4 Codable protocol and KeyPaths to provide a Swift-y interface to CoreData. (It maps back and forth between native, immutable Swift structs and NSManagedObjects). In doing so I found a couple of frustrating

[swift-evolution] [Pitch?] Way to declare a Swift Array that guarantees it can't be empty

2017-08-08 Thread Logan Shire via swift-evolution
You would have this guarantee with the fixed-size arrays currently being discussed. Perhaps this could be an amendment to that proposal - you could declare an array with bounds for its size. Fixed-size arrays would be a subset of those where the upper and lower bounds are equal. They could

Re: [swift-evolution] [Pitch] Improving unspecified generic usability

2017-08-08 Thread Logan Shire via swift-evolution
pe theory when dealing with generics and protocols, > but that's just me. > > > Elviro > > > Il giorno 08 ago 2017, alle ore 10:44, Logan Shire via swift-evolution < > swift-evolution@swift.org> ha scritto: > > Thanks for the feedback! > > Félix, sorry about the conf

[swift-evolution] [Pitch] Improving unspecified generic usability

2017-08-07 Thread Logan Shire via swift-evolution
One of my longstanding frustrations with generic types and protocols has been how hard it is to work with them when their type is unspecified. Often I find myself wishing that I could write a function that takes a generic type or protocol as a parameter, but doesn’t care what its generic type