You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce array spread operator for pattern matching and [] [11462964]
Submitted by Ryan Riley on 1/15/2016 12:00:00 AM 18 votes on UserVoice prior to migration
Several languages have introduced a handy spread operator, ..., that can be used to pick up remaining arguments to a function call or when destructuring values. [1] This would be incredibly helpful in F# to reduce boilerplate in methods accepting a [] or when trying to pattern match arrays:
match [|1;2;3;4|] with
| [||] -> // do stuff with empty array
| [|hd;…tl|] -> // do stuff with hd/tl
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator
Response
** by fslang-admin on 2/3/2016 12:00:00 AM **
Declined per my comment below. We would not extend pattern matching for this one case, but Rick is right that improvements to active patterns may make sense
Don Syme, F# Language Evolution
Introduce array spread operator for pattern matching and [] [11462964]
Submitted by Ryan Riley on 1/15/2016 12:00:00 AM
18 votes on UserVoice prior to migration
Several languages have introduced a handy spread operator, ..., that can be used to pick up remaining arguments to a function call or when destructuring values. [1] This would be incredibly helpful in F# to reduce boilerplate in methods accepting a [] or when trying to pattern match arrays:
match [|1;2;3;4|] with
| [||] -> // do stuff with empty array
| [|hd;…tl|] -> // do stuff with hd/tl
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator
Response
** by fslang-admin on 2/3/2016 12:00:00 AM **
Declined per my comment below. We would not extend pattern matching for this one case, but Rick is right that improvements to active patterns may make sense
Don Syme, F# Language Evolution
Original UserVoice Submission
Archived Uservoice Comments
The text was updated successfully, but these errors were encountered: