A strongly typed, multi-paradigm programming language developed by the F# Software Foundation, Microsoft, and open contributors.
We tried with F# to declare but its not possible.
Thanks
VPL
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
In C# I can create a list of tuples with named fields, such as:
new List<(Guid stageId, Guid formId)>()
Is it possible in F# to declare a Discriminated Union with list of tuples with named fields, for example:
type Assignment = Assignment of ((stageId: Guid, formId: Guid) list)* (payload: string)
A strongly typed, multi-paradigm programming language developed by the F# Software Foundation, Microsoft, and open contributors.
We tried with F# to declare but its not possible.
Thanks
VPL
Hey VPL
Thanks for your concern but we do not understand your question about F#.. Can you please more clear about your question.
Regards
Billy RP
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
Yes, your syntax is valid in F#, but the idiomatic and safer print approach is to define a record type instead of relying on named tuples inside a discriminated union.
type Assignment =
{ Items : StageForm list
Payload : string }
That’s typically the most F#-idiomatic solution.