DavidArno / SuccincT

Discriminated unions, pattern matching and partial applications for C#
MIT License
267 stars 15 forks source link

Add pattern matching to the Either type #62

Closed DavidArno closed 4 years ago

DavidArno commented 5 years ago

The Either<TLeft, TRight> type doesn't currently support pattern matching.

Add pattern matching support, along the lines of what's available for Union<T1, T2>, except that:

  1. Case1 should be Left,
  2. Case2 should be Right,
  3. CaseOf<T> is not needed.
DavidArno commented 4 years ago

Done.