78 packages tagged with “Discriminated”
F# style discriminated unions for C#, using a custom type OneOf<T0, ... Tn> which holds a single value and has a .Match(...) method on it for exhaustive matching. Simple but powerful.
This source generator automaticly implements OneOfBase hierarchies
This package extends the OneOf types from OneOf<T0, .., T9> to OneOf<T0, .., T32> for when you really have a lot of options
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 works not just for enums, but for classes and interfaces. Turn them into discriminated unions (aka sum types) by marking them with the 'Closed' attribute and listing the cases. ExhaustiveMatching.Analyzer goes beyond what other languages support by handling full inheritance hierarchies.
Immutable persistent collections, algebraic sum-type aka descriminated union, Ref type and supportive extensions for performant functional programming in C#. Split from the DryIoc: https://github.com/dadhi/DryIoc
Json serialization converters for F# option types and discriminated unions.
A simple source generator for discriminated unions in C#.
This is an FSharp library for interop with the C# OneOf Types
Suppresses exhaustiveness warnings of switch statement and switch expressions when all cases of a "closed type hierarchy" are covered. See project URL for details. It suppresses IDE0010, IDE0072 and CS8509. It is NRT-aware.
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 Maybe<T>, if you prefer), rather than using the out parameter anti-pattern. * "cons" support for IEnumerable<T> (add elements to the head of an enumeration, or split an enumeration into its head element and an enumeration containing the remaining items, all without repeatedly enumerating that enumerable). * Indexed enumerations, * Cycle() methods that endlessly repeat an enumeration, again without repeatedly enumerating that enumerable). * Replacements for IEnumerable<T>'s XXXOrDefault methods that return an Option<T> (or Maybe<T>, if you prefer), avoiding null and the "did it return a value, or the default?" problem, * And finally, basic parameter piping support.
CodeJam is a set of handy reusable .NET components that can simplify your daily work and save your time when you copy and paste your favorite helper methods and classes from one project to another.
This package provides Discriminated Unions for C#. This is the old backage. The new package is FunctionalSharp.DiscriminatedUnions.
This package helps to serialize .NET/C# classes hierarchy as a tagged union (also known as a discriminated union).
A small package allowing you to use Union Structs
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.
OneOf Extensions
A source generator that generates `Match` methods for all your discriminated unions needs. ✨
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!") or var x = new Union<string, int>(100); // the type annotations below are optional and only added for clerity. string value = x.Match<string>() .Case((string v) => v) .Case((int c) => c == 100, (int v) => "Keeping It 100.") .Case((int v) => "Tea?") .Else(() => "Nothing"); Assert.Equal("Keeping It 100.", value);
The Source Generator for AterraEngine.Unions
Package Description
UnionStruct is a C# source generator for creating memory-efficient union structs.
F# style discriminated unions or C#, using a custom type OneOf<T0, ... Tn> which holds a single value and has a .Match(...) method on it for exhaustive matching. Simple but powerful.
An implementation of a discriminated union data structure with pattern matching support.
Contains the attributes for the nuget package CSharpDiscriminatedUnion
Suppresses exhaustiveness warnings of switch statement and switch expressions on OneOf<...>.Value from the OneOf library when all type arguments are covered. See project URL for details. It suppresses IDE0010, IDE0072 and CS8509. It is NRT-aware.
Tagged union for c#