union-type-fsharp

FSharp · Script

/Program.fs

type TypeA = { A: string }
type TypeB = { B: string }

type MyUnionType = TypeA | TypeB

type MyContainer = { Union: MyUnionType }

let resultA = { A = "abc" }

let result = { Union = resultA }

printfn "%A" result
;