-
Notifications
You must be signed in to change notification settings - Fork 830
[FS-1030] - Anonymous records #2671
New issue
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
Conversation
|
I didn't see an example of decomposition, will this be possible? let {| x = x |} = anonymousRecordWhat would the Kind B syntax be like for this? |
|
@et1975 I'm not certain we need to allow decomposition for these (I'm not a big fan of pattern matching on records). But if we did, it would be |
|
It's fantastic. I didn't even know it's coming or even RFCed.
let x = {| IntF = 1; StringF = "foo" |}
printfn "x = %A" x
> x = (1, "foo")
|
|
@yawaramin actually please ask that one on the RFC thread |
|
@dsyme sorry, I deleted my question after I thought about it some more--I think I understand the difference, but I will repost on the RFC thread (i.e. fsharp/fslang-design#170 ) in case the discussion brings value. |
|
I've updated the PR to include code for equality, comparison, ToString and record-reflection |
ensure build outputs always go to `$(Configuration)\$(TargetDotnetProfile)\bin`
Re-enable F5 on VisualFSharp.sln
use VS version as base for insertion packages
Add commit hashes to NuGet and Visual Studio packages
* Toggles for outlining and structured guidelines * Cleanup * Don't remove outlining alongside block structure lines and better names * fix up rebase;
* fix cancellation for PostAndAsyncReply * fix tests
consolidate Newtonsoft.Json version to match what's shipped in VS
…dotnet#4385) * Remove dependency on FSharp.LanguageService from FSharp.ProjectSystem * Fix bad merge
* clean option module in illib * Update NicePrint.fs * Update NicePrint.fs * Update NicePrint.fs * Update NicePrint.fs * Update NicePrint.fs
* Create a test that shows broken comparison on float32 * fix comparison of float32
|
Closed as targeted dev15.6 for some reason |




This adds anonymous records to the F# compiler per RFC FS-1030.
Please discuss on the RFC or below - if the discussion gets long we will move to the RFC discussion thread.
The implementation is not yet complete but I believe it to be stable and usable - there are just some corner cases to finish off and considerably more testing to add, specifically
Design:
Implementation:
{| X = 1; Y = 2 |}Kind B types{| X = 1; Y = 2 |}Kind B typessprintf "%A"on{| X = 1; Y = 2 |}Kind B typesTesting:
{| X = 1; Y = 2 |}types for working with known common libraries accepting C# anonymous typesIf anyone wants to give a hand with the testing that would be great. I think it's really important that someone else besides myself do serious testing on this feature. I'd love someone to try this out and give early feedback on usability and "fit and polish".
Note: F# Interactive currently doesn't work properly: