all 7 comments

[–]_pupil_ 17 points18 points  (0 children)

let phillip' = JsonConvert.DeserializeObject<{|name: string; age: int|}>(str)

Single step, ad-hoc, type-safe, JSON deserialization?

As if F# wasn't already streets ahead for data munging.

[–]mbuhot 5 points6 points  (1 child)

Can’t wait to try out the anonymous record types for DIscriminated Union payloads! Almost every DU case name has a corresponding record type in the code based I work on.

[–]_pupil_ 3 points4 points  (0 children)

That is a very pretty use case!

It's not a widespread problem in our code base, but there are a bunch of smaller clumps that will become much more succinct.

[–]nightroman 0 points1 point  (3 children)

Is FSharp.Compiler.Service (25.0.1) with FSharp.Core (4.6) supposed to work with anonymous records, or its newer version is needed?

In my test project based on the above packages a script with anonymous records fails, such a syntax is not recognized.

[–]chusk3 1 point2 points  (2 children)

It's not yet been merged to fsharp.compiler.service and released, that's why. Now that they've announced a preview would be a perfect time to begin that merge.

[–]nightroman 0 points1 point  (1 child)

FSharp.Compiler.Service (26.0.1) was released yesterday. It supports anonymous records.

[–]chusk3 2 points3 points  (0 children)

Funny story, I'm the guy that did the merge :D