I am fairly new in F# and having some problems with choice type implementation.
I have three types.
type A = p of string
type B = {q:string;r:int}
type C = s of string
Then I've a choice type like this.
type D = A | B | C
Now I am having problems in creating D type of variable. I am trying to do something like this,
let v = {q="abc";r=12}
let vofD = D.B v
But it gives this error,
This value is not a function and cannot be applied
I have tried to search for documentation on this thing and it seems that I'm unable to find any good document or solution on this. Any help will be greatly appreciated.
question from:
https://stackoverflow.com/questions/65861245/choice-type-implementation-in-f 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…