On Mon, Jun 12, 2017 at 8:52 PM, John McCall <rjmcc...@apple.com> wrote:
>
>
> We really do want to tie most of these features specifically to function
> calls.
>


I'm not sure if I understand what you mean. Do you mean that you really
don't want these features to require changes to the type system?

My main problem/missing feature with function types in Swift 4 is not being
able to express a generic function type as A -> B, instead I would have to
do this:
(A) -> B
(A, B) -> C
(A, B, C) -> D
...
...
Ie it is impossible to fully express something that I normally see as just
A -> B.

Another example could be describing any two function types that are
composable:
A -> B and B -> C

This also becomes impossible using Swift 4 function types:
(A) -> B and (B) -> C
(A, B) -> C and (C) -> D
(A) -> (B, C) and (B, C) -> D
...
...
... etc, etc, ...

One solution that is already possible is of course to only use functions
with one (tuple) argument in these and similar scenarios. But that's still
a bit awkward.

/Jens
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to