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
I encountered https://github.com/mcintyre321/OneOf which allow to do exhaustive matching (without pattern matching) on a OneOf generic types with different arities.
`The suggestion is to add Match and Switch methods:
This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.
Please tick all that apply:
This is not a breaking change to the F# language design
I would be willing to help implement and/or test this
I or my company would be willing to help crowdfund F# Software Foundation members to work on this
The text was updated successfully, but these errors were encountered:
Ultimately I believe this area (making DUs easily-consumable in C# and VB) is going to be driven by the C# design team (ping @MadsTorgersen) and the .NET API team (ping @terrajobst). We could make as many changes as we like to make to DUs more easily consumable from C# and VB, but serious use of DUs in C# and VB would have to be driven by a desire from the language and .NET to make those types first-class. I believe the decision-making process would look something like this:
Are records/DUs something that solves a big problem with C# and VB users, and will they really want to use those types?
Is it desirable to take some of these types from FSharp.Core and add them to .NET?
Is it desirable from the .NET side to add more overloads to .NET APIs to now use these types, and change guidance to prefer using these over previous patterns (e.g., out parameters and C#7/VB15 tuples for TryParse methods)?
The proposal so far helps cure some awkwardness in libraries like OneOf, which is fine, but I would caution against further modifications until something like DUs materializes more on the C# and .NET side. Without the language features and APIs in .NET to make DUs awesome, I don't see why a C# consumer would want to consume an F# DU.
I encountered https://github.com/mcintyre321/OneOf which allow to do exhaustive matching (without pattern matching) on a
OneOf
generic types with different arities.`The suggestion is to add Match and Switch methods:
For option type, using from C#:
Pros and Cons
The advantages of making this adjustment to F# are
The disadvantages of making this adjustment to F# are
Extra informtion
Estimated cost : M
Related suggestions: dotnet/fsharp#1254
Affadavit
Please tick this by placing a cross in the box:
Please tick all that apply:
The text was updated successfully, but these errors were encountered: