Chris Lattner has a proposal under review <https://github.com/apple/swift-evolution/blob/master/proposals/0048-generic-typealias.md> on this topic.
milos > On 6 Apr 2016, at 20:41, James Campbell via swift-evolution > <swift-evolution@swift.org> wrote: > > This was inspired from the topic about moving where clauses out of parameter > lists. > > Certain generics get very long winded, I was wondering if we could create > some sort of alias for generics. > > func anyCommonElements <T: SequenceType, U: SequenceType where > T.Generator.Element: Equatable, T.Generator.Element == U.Generator.Element> > (lhs: T, _ rhs: U) -> Bool > > could be shared across functions like so: > > genericalias SequencesWithSameElements<T, U> = <T: SequenceType, U: > SequenceType where T.Generator.Element: Equatable, T.Generator.Element == > U.Generator.Element> > > func anyCommonElements <SequencesWithSameElements> (lhs: T, _ rhs: U) -> Bool > func == <SequencesWithSameElements> (lhs: T, _ rhs: U) -> Bool > ___________________________________ > > James⎥ > > ja...@supmenow.com <mailto:ja...@supmenow.com>⎥supmenow.com > <http://supmenow.com/> > Sup > > Runway East > > > 10 Finsbury Square > > London > > > EC2A 1AF > > _______________________________________________ > swift-evolution mailing list > swift-evolution@swift.org > https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution