[RFC FS-1049] Nested Record Field Copy and Update Expression #733
Replies: 2 comments 3 replies
-
With the basic implementation essentially complete, I would like to discuss unresolved questions/the next steps.
I assume this syntax would require that Replacing a tuple element would indeed be much more useful. However, I have no idea how such an intent would be expressed. We could utilize All in all, I am at a loss as to how we could improve the interplay of nested record field updates with other types short of introducing entirely new syntax. |
Beta Was this translation helpful? Give feedback.
-
Yes, my problems are more conceptual - it's a feature that ties more syntax to one particular kind of types. Tricky area as logically the nested update makes sense for other types, there's just no way to express it. It's a bit like pattern matching in this way (hence active patterns were added). Perhaps the solution is active lenses :) Speaking of which, I guess there's a question whether nested pattern access should also be allowed in matches, for uniformity (but no, you don't need to add this to the RFC, though maybe make a note of it somewhere)
|
Beta Was this translation helpful? Give feedback.
-
Revived implementation in dotnet/fsharp#14821, (archived) RFC.
Beta Was this translation helpful? Give feedback.
All reactions