That problem could be solved with the combining tilde, however it isn’t easy, because it’s simply not easy to type. If ~> would describe the pure function and -> an impure function then the combination of both would be ≃>.
One thing I noticed, you said that the function itself will become pure or impure depending on the other function. Doesn’t this imply that -> is exactly this pure OR impure function. It’s either or but never both right? Otherwise it might lead us to a huge breaking change. A suggestion building on top of the arrow syntax we could have: pure function: ~> impure function: ≈> (That’s a ‘double tilde’) pure or impure function: -> (it is as to top and bottom tilde was merged and smoothed together) -- Adrian Zubarev Sent with Airmail Am 17. Februar 2017 um 17:43:21, Matthew Johnson ([email protected]) schrieb: Well sure, but then you have just supplied the type annotation. I am describing a specific scenario where an API can accept a function that is pure or a function that is impure and will have the purity of the function passed into it.
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
