[swift-evolution] [Pitch] Support for pure functions. Part n + 1.
adrian.zubarev at devandartist.com
Fri Feb 17 12:35:04 CST 2017
My suggestion is that -> would be the conditional arrow that can be both pure or impure. That would make @pure func foo(_ f: @pure (Int) -> Int) -> Int equivalent to func foo(_ f: (Int) ~> Int) -> Int. Plus depending on the implementation the compiler might be able to help and tell you that foo could use ~> instead.
Sent with Airmail
Am 17. Februar 2017 um 19:25:41, Anton Zhilin (antonyzhilin at gmail.com) schrieb:
@pure func foo(_ f: (Int) -> Int) -> Int
be the same as those two combined:
@pure func foo(_ f: @pure (Int) -> Int) -> Int
func foo(_ f: (Int) -> Int) -> Int
No need for anything like “re-pure” or
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution