[swift-evolution] [swift-evolution-announce] [Review] SE-0048: Generic Type Aliases

Brent Royal-Gordon brent at architechies.com
Sat Mar 26 00:04:25 CDT 2016

> https://github.com/apple/swift-evolution/blob/master/proposals/0048-generic-typealias.md

> 	• What is your evaluation of the proposal?

I think it's a good idea that will make a lot of code clearer.

I agree with the decision not to support additional constraints on the generic type. Typealiases should be just what it says in the name: aliases. It should not be possible to constrain a type with a typealias in a way you could not by substituting the same type name in directly.

In other words, I don't think this:

	typealias ComparableArray<T where T : Comparable> = Array<T>

Makes any more sense than this:

	Array<T where T: Comparable>

> 	• Is the problem being addressed significant enough to warrant a change to Swift?

Yes. The "proposed solution" examples are all quite sensible.

> 	• Does this proposal fit well with the feel and direction of Swift?


> 	• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

I haven't used any such languages enough to ever use an equivalent feature.

> 	• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

Quick reading.

Brent Royal-Gordon

More information about the swift-evolution mailing list