2 ms·
What you are describing is something different called a disjoint union which will maintain the identities of the left and right values when there is overlap. T
by jafffsuds 4mo ago
What you are describing is something different called a disjoint union which will maintain the identities of the left and right values when there is overlap.
The C# unions appear to behave like unions, not disjoint unions.
- bertylicious 4mo agoMy mistake. I see my oversight now. `Either String String` is not equivalent to `String | String`, but to `Left String | Right String`. The same must be done for the C# version. You are correct that this requires support for disjoint unions (aka tagged unions), which Haskell always had and C# will soon have.