Language-ext: Match for [Union] types?

Created on 11 Jan 2020  路  1Comment  路  Source: louthy/language-ext

There has been such a vast number of significant improvements lately that I have been unable to keep up! :)

I am interested in using the new Union attribute, but I am a bit confused. I was expecting there to be a way to exhaustively handle cases, especially by a method named Match. There isn't a method by that name, and I don't see any other method that fits that description?

Is there a way to exhaustively handle all the cases in a Union type?

Most helpful comment

This is on the TODO list for [Union] types, currently you have to use C# pattern-matching with a wildcard match to catch all cases. Obviously, that doesn't help too much when adding new cases, which is where a Match function would come in handy.

>All comments

This is on the TODO list for [Union] types, currently you have to use C# pattern-matching with a wildcard match to catch all cases. Obviously, that doesn't help too much when adding new cases, which is where a Match function would come in handy.

Was this page helpful?
0 / 5 - 0 ratings