Is there any way to crate nested union types in F#? Something like this
type MainType =
| A of
| AA of int
| AB of float
| B of int
No, I don't think so. The doesn't seem to be much advantage over creating two separate union types like:
type NestedType =
| AA of int
| AB of float
type MainType =
| A of NestedType
| B of int
let mainValue = A (AA 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With