> On 14 May 2016, at 16:52, Tony Allevato via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> To me, this makes declarations with complex sets of constraints much harder 
> to read, because I have to hunt them down instead of finding them all in one 
> place. Under this proposal, the longer an argument list gets, the further 
> separated the constraints are from the type parameters that use them.

This is partly an issue of how you use the feature rather than an issue with 
the feature itself, as you’re assuming that everything is all on one line, but 
really I think the intent of this feature is to better support multi-line 
declarations. It enables things like:

        func someMethod<S:SequenceType, T>(value:S) -> AnySequence<T>
                where S.Generator.Element == T { … }

The actual function signature stays on the top, but the constraint can now move 
down neatly, since it’s a supplementary condition that you may not to consider 
right away, or at all, if it’s just reinforcing some kind of common-sense 
limitation.

This is partly why I’d prefer to see it optional though, as some things will 
fit on one line reasonably well (you probably could with the above for 
example), but like you say, with it all on one line the return type becomes 
less visible.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to