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
It has been suggested that we support
from (a, b) in Pairs select a * b from t in Pairs let (a, b) = t select a * b
The text was updated successfully, but these errors were encountered:
Feels like a good first step towards #6877, starting with compiler-verified guaranteed to succeed tuple patterns.
Sorry, something went wrong.
Definitely seems like a good idea. +1
Ufff! for a moment I believed the asterisk (in the second example) represented an F-Sharpesque tuple style.
While we anxiously wait for this to appear in a future version of C#, one could deconstruct via a folding function for tuples, like this:
static class TupleExtensions { public static TResult Fold<T1, T2, TResult>(this (T1, T2) tuple, Func<T1, T2, TResult> folder) => folder(tuple.Item1, tuple.Item2); }
and then use it in LINQ as follows:
from t in Pairs select t.Fold((a, b) => a * b);
This language feature requests is tracked by dotnet/csharplang#189 I'll go ahead and close this Roslyn issue. Thanks
MadsTorgersen
No branches or pull requests
It has been suggested that we support
The text was updated successfully, but these errors were encountered: