Simplify consumption of C# centric object builders
I propose we add support in some form to allow the construction of objects in line with how API:s are defined for use in C#
One alternative that might go with the grain of current usage of computation expression builders would be the possibility of a computation expression wrapper that allows for constructing mutable objects in a similar fashion to how they are constructed in C# syntactic sugar for object and collection initializers. Similar functionality exists within VB.net, but in a manner more appropriate for that style of programming.
The existing way of approaching this problem in F# is to do something similar as:
let v = ConfigurationBuilder(UseExplicitWhatnot = true)
v.Sublevel.BasementMapping <- mapping
v.ListOfFloors.Add floor1
...
that's fine for small usages of C# API:s, but can be a bit annoying when trying to consume larger chunks.
Pros and Cons
The advantages of making this adjustment to F# are to make it more compatible with C# intended API:s
The disadvantages of making this adjustment to F# are that it could complicate the F# compiler.
Extra information
Estimated cost (XS, S, M, L, XL, XXL):
I'm unsure about the cost since this is sort of a rough suggestion
Related suggestions: (put links to related suggestions here)
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
Simplify consumption of C# centric object builders
I propose we add support in some form to allow the construction of objects in line with how API:s are defined for use in C#
One alternative that might go with the grain of current usage of computation expression builders would be the possibility of a computation expression wrapper that allows for constructing mutable objects in a similar fashion to how they are constructed in C# syntactic sugar for object and collection initializers. Similar functionality exists within VB.net, but in a manner more appropriate for that style of programming.
The existing way of approaching this problem in F# is to do something similar as:
that's fine for small usages of C# API:s, but can be a bit annoying when trying to consume larger chunks.
Pros and Cons
The advantages of making this adjustment to F# are to make it more compatible with C# intended API:s
The disadvantages of making this adjustment to F# are that it could complicate the F# compiler.
Extra information
Estimated cost (XS, S, M, L, XL, XXL):
I'm unsure about the cost since this is sort of a rough suggestion
Related suggestions: (put links to related suggestions here)
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply: