I am trying to design an AST for a decision logic table.One of the things I would like to be able to do with the discriminated union that represents my AST is transform parts of it for different reaso
I am writing a F# program which parses a string into a AST type which is a discriminated union. When I use fsi (on Mono + Mac OS X) to run my code, the AST is printed out in a nice format. But when
I know it\'s possible to add methods and properties to discriminated unions, but can you add an immutable field that has to be set when an instance the union is created, much like the fields in a reco
I have the following code: public abstract class A ... public class B : A ... public class C : A ... void my_fct(A x) {
Let\'s say I am implementing a very simple toy language parser. I am deciding whether to use DUs or record types (maybe a mix of both?). The structure of the language would be:
let Method = { Name:string } //oversimplification let method_parser = spaces >>. many1Satisfy isLetter .>> spaces
I have a function, which can returns different types, and I use discriminated union for this. What I need, is to have conversion from one type in discriminated union to another type.
First, sorry for the lengthy post. Basically, my question is this: I\'m trying to reproduce the following F# discriminated union type in C#:
Using F# for the first time for a production thing and need a little help. Please see this code where I added the warnings I get as comments on each line:
Given a mapping program where I map from an array of strings to a discriminated union, I want to select an instance of a particular DU type. I know that there will be 0 or 1 instances. Is there a smar