Hi all,
We probably don't need additional syntax to achieve this. I just wrote a
library which allows you to `(pass?.aLongOptionalChaining()?.to ?<
aFunctionTakingNonOptionalValues(:))?.ThenDoSomethingElse()` with `?>` operator.
The multiple parameters example:
(john.address, alice.address, 2.0) ?>
getPostageEstimate(source:destination:weight:)
> // Equivalent to
> john.address.flatMap { freshVar1 in
> alice.address.flatMap { freshVar2 in
> getPostageEstimate(source: freshVar1, destination: freshVar2,
> weight: 2.0)
> }
> }
See more about the library: https://github.com/ddddxxx/ChainingFunction
<https://github.com/ddddxxx/ChainingFunction>
--
Xander
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution