News for hackers. Stuff that matters.
Re:C# Pattern Matching by throwawa66 on Tuesday February 04, 2020 @04:54PM (#22241441)
Yes, i find that a good argument especially if you plan on using this feature a lot it can save you from shooting yourself in the foot. It also is a better idiom in F#, nicer to grok, but that’s subjective.

However, only direct experience will make you reconsider.

I’ve seen a discriminated union implementation in C# the other day and was repulsed.

Re:C# Pattern Matching by DaiPlusPlus on Tuesday February 04, 2020 @07:27PM (#22242743)
I use OneOf<T...> in C# a lot now. If you’re thinking of the same one I am the only ugly thing about it is the code-generation required to generate all of the variations from OneOf<T0,T1> to OneOf<T0,T1,T2,T3,T4,T5,T6>.