On Apr 20, 2016, at 9:46 AM, BJ Homer via swift-evolution
<swift-evolution@swift.org> wrote:
>
> How would this proposal affect curried functions? Would this:
>
> func foo(int: Int) -> Int -> String -> String
>
> become this?
>
> func foo(int: Int) -> (((Int) -> String) -> String)
>
> As I understand, that transformation is an accurate representation of the
> actual return type of “foo”, but it’s certainly going to raise some
> complaints among the functional Swift community if required.
>
> -BJ
To the best of my understanding, either:
func foo(i: Int) -> (j: Int) -> (s: String) -> String { ... }
let x = foo // let x: (Int) -> (j: Int) -> (s: String) -> String
let a = x(2); let b = a(j: 3); let c = b(s: "glob"); print(c)
or
func blort(i: Int) -> (Int) -> (String) -> String
let z = blort // let z: (Int) -> (Int) -> (String) -> String
let aa = z(2); let bb = aa(3); let cc = bb("glob"); print(cc)
would still work (although x(2) would become x(i: 2) because of the new first
label rules) vs the following which currently works but would not after
adoption:
func bar(i: Int) -> Int -> String -> String { ... }
let y = bar // let y: (Int) -> Int -> String -> String
-- E, who is often wrong
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution