We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swift had tuple Splatting, which was awesome. Now we don't have it, which sux.
I've been missing it for years now as I have it on my standard toolbelt / programming logic coming from different languages.
I have no clue who this genius is on Swift Forums, but this comment gave me the idea below:
import Foundation infix operator |> : MultiplicationPrecedence func |> <Input, Output>( input: Input, lambda: (Input) -> Output ) -> Output { lambda(input) } func call<Args, Result>(with args: Args, function: (Args) -> Result) -> Result { function(args) } func add(_ a: Int, _ b: Int) -> Int { a + b } // this still compiles today let input = (40, 2) print(call(with: input, function: add)) print(input |> add)
The text was updated successfully, but these errors were encountered:
Postponed until the new swift generic tuple expansion black magic is convincingly stable.
Sorry, something went wrong.
No branches or pull requests
Swift had tuple Splatting, which was awesome.
Now we don't have it, which sux.
I've been missing it for years now as I have it on my standard toolbelt / programming logic coming from different languages.
I have no clue who this genius is on Swift Forums, but this comment gave me the idea below:
The text was updated successfully, but these errors were encountered: