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

Usual .NET constructors for Discriminated Unions #615

Closed
DjArt opened this Issue Oct 24, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@DjArt

DjArt commented Oct 24, 2017

Usual .NET constructors for Discriminated Unions

I propose we add usual constructors for discriminated unions for interop F# to C#. Now, we must to use functions, like "type".New"case"(params). But, F# generates classes for this cases, may be they should releases constructors?

  • This is not a question (e.g. like one you might ask on stackoverflow) and I have searched stackoverflow for discussions of this issue

  • I have searched both open and closed suggestions on this site and believe this is not a duplicate

  • 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.

  • This is not a breaking change to the F# language design

@dsyme

This comment has been minimized.

Show comment
Hide comment
@dsyme

dsyme Nov 16, 2017

Collaborator

Note that F# doesn't always generate classes for union cases, e.g. it doesn't generate a class for unary alternatives, nor for struct unions. So the choice to use New was about giving F# room to make choices like this

As a result I will close this suggestion

Collaborator

dsyme commented Nov 16, 2017

Note that F# doesn't always generate classes for union cases, e.g. it doesn't generate a class for unary alternatives, nor for struct unions. So the choice to use New was about giving F# room to make choices like this

As a result I will close this suggestion

@dsyme dsyme closed this Nov 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment