DavidArno / SuccincT

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

Add positional pattern matching support to ValueOrError types #66

Closed DavidArno closed 4 years ago

DavidArno commented 5 years ago

Add the means to do something like:

var result = ValueOrError switch {
    (Value, x, _) => $"value-{x}",
    (Error, _, x) => $"error-{x}"
};

to the ValueOrError and ValueOrError<TV,TE> types via deconstructors.

DavidArno commented 4 years ago

Done.