ExhaustiveMatching.Analyzer adds exhaustive matching to C# switch statements and expressions.
Get compiler errors for missing cases in a switch statement or expression. Mark which switches should have exhaustiveness checking by throwing an exception in the default case. Exhaustiveness checking...
Succinc<T> is a .NET library that adds a number of functional features to C#:
* Discriminated unions,
* Pattern matching,
* Partial applications,
* "Implicitly" typed lambdas,
* The ability to treat void methods as Unit functions,
* Replacements for TryParse methods that return an Option<T> (or...
Implementation of Discriminated Union and Pattern Matching in C#.
string outputValue = x.Match<String>()
.Case(c => c == "Test", v => "It's Test!")
.Case(v => "It's Not Test!")
.Else(() => "It's None!")
var x = new Union<string, int>(100);
// the type annotations...
Portable library for easy to use F#-like Discriminated Unions in C#. Implicitly casts objects into OneOf instances, then use .Match extension to do pattern matching. Designed as a partial drop in replacement for OneOf.