[swift-evolution] [Pitch] Moving where Clauses Out Of Parameter Lists

Milos Rankovic milos at milos-and-slavica.net
Wed Apr 6 14:55:15 CDT 2016


> For example, this Standard Library function:
> 
>     public func + <
>         C : RangeReplaceableCollectionType,
>         S : SequenceType
>         where S.Generator.Element == C.Generator.Element
>     > (lhs: C, rhs: S) -> C
> 
> would become:
> 
>     public func + (lhs: C, rhs: S) -> C where <
>         C : RangeReplaceableCollectionType
>         C : SequenceType
>         S.Generator.Element == C.Generator.Element
>     >
> 

As for structs, this Standard Library struct:

	public struct FlattenBidirectionalCollection <Base : CollectionType where Base.Generator.Element : CollectionType, Base.Index : BidirectionalIndexType, Base.Generator.Element.Index : BidirectionalIndexType> : CollectionType { … }

… could become:

	public struct FlattenBidirectionalCollection<Base> : CollectionType where <
		 Base : CollectionType
		 Base.Generator.Element : CollectionType
		 Base.Index : BidirectionalIndexType
		 Base.Generator.Element.Index : BidirectionalIndexType
	> { … }

milos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160406/582e7f65/attachment.html>


More information about the swift-evolution mailing list