[swift-evolution] Will these two features be included in Swift 3?

tuuranton at tutanota.de tuuranton at tutanota.de
Tue Dec 8 06:04:14 CST 2015


>  However, I personally like the idea of making a syntactic sugar for that 
> case.
Thanks! I didn't know I could do it like that.Yeah, someone please add that 
syntactic sugar. That would be really cool. Otherwise my namespace gets 
polluted with that DoubleProtocol, minor drawback :)

--
Securely sent with Tutanota. Claim your encrypted mailbox today!
https://tutanota.com

7. Dec 2015 13:14 by krzysztof at siejkowski.net:


> Concerning extension constraining, it’s already doable with:
> ```> protocol DoubleProtocol {}
> extension Double : DoubleProtocol {}
> extension Array where Element : DoubleProtocol {>     func onlyForDoubles() 
> -> String {>             return "hello doubles!">     }> }
> [1.2].onlyForDoubles() // „hello doubles!”> ["a"].onlyForDoubles() // 
> error: type of expression is ambiguous without more context> ```
> However, I personally like the idea of making a syntactic sugar for that 
> case.
> All the best,> Krzysztof>
>  >
>
> On 7 December 2015 at 13:01:11, Krzysztof Siejkowski (> 
> krzysztof at siejkowski.net> ) wrote:
>

> Concerning generic typealiases, the topic is already beingdiscussed in 
> „Generic `typealias`s” thread: > 
> https://lists.swift.org/pipermail/swift-evolution/2015-December/000132.html> 
> .The core Swift team approves:
> > > Yes, this isdefinitely something that I (at least) would like to see. 
> Patcheswelcome :-)> > Chris(Lattner)
> All the best,> Krzysztof
>
> On 7 December 2015 at 12:41:05, Tuur Antonvia swift-evolution (> 
> swift-evolution at swift.org> )wrote:
>
>> Can you please add these features in Swift3?
>> 1. The ability to do this:>> extension Array<Double> {>>     //extend 
>> arrays of doubles>> }
>> 2. Generic typealiases:>> struct Foo<T,V> {>>     let t: T>>     let v: 
>> V>> }>> typealias IntFoo<V> = Foo<Int,V> //Error inSwift 2.1>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151208/5ef912a8/attachment.html>


More information about the swift-evolution mailing list