Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
struct tuple splatting #782
struct tuple splatting
I propose we allow struct tuples to be inferred when applying to tuple functions.
static member M(x:struct(int * int) seq) = // struct tuples are C# friendly Seq.iter N x // FS0001 One tuple type is a struct tuple, the other is a reference tuple static member N(x:int, y:int) = …
The above code should be allowed.
The existing way of approaching this problem in F# is
static member M(x:struct(int * int) seq) = Seq.iter (fun struct (x, y) -> N(x, y)) x // Extra syntax static member N(x:int, y:int) = …
static member M(x:(int * int) seq) = // C# unfriendly reference tuples Seq.iter N x static member N(x:int, y:int) = …
Pros and Cons
The advantages of making this adjustment to F# are
The disadvantages of making this adjustment to F# are none that I can think of.
Estimated cost (XS, S, M, L, XL, XXL): S
Related suggestions: No
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply: