Say I have a DU , which I cannot (or do not want to) change:
type OrDU =
| A
| B
| C
Now in another program I need a DU, which is identical to the above except it needs a few additional cases.
type ExtraDU =
inherit OrDU
| D
| E
However, DU's cannot be extended. What is the best solution for this?
Ideally I want easy interop, that is a OrDu
can be used as a ExtraDU
, and an ExtraDU
without the extra cases can be converted back to a OrDU
.