Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.8% on nuget.org

nuget.org : johnaz.csharp.uniontypes

Languages like F#, Scala and Haskell have special types to represent a choice of a finite set of values. These types are variously called 'Union Types', 'Sum Types' or 'Discriminated Unions (DUs)'. Union Types are a powerful way of representing choices. They enforce value semantics and can represent choices between other Record and Union types. They are very useful constructs because they can help model the domain of a problem more precisely, and can help eliminate entire classes of runtime bugs. Modern C# provides record types, which implicitly implement value semantics; and has suport for pattern matching - both of which make implementation of Union Types possible, if tedious. This library relieves us of the tedium of building out boilerplate code for Union Types. Instead, one is able to define Union Types in a DSL with syntax that is familiar to C# users, and have the source-generator based library generate the necessary code to support pattern matching and other idiomatic C# features. The objects generated are extensible so additional methods can be added to them allowing these Union Types to be used in a rich domain model.

Registry - Homepage - JSON
purl: pkg:nuget/johnaz.csharp.uniontypes
Keywords: C#, CSharp, Types, Discriminated, Unions, Union, Choice, Sum, Type, Theory, DSL
License: MIT
Latest release: 26 days ago
First release: 26 days ago
Stars: 48 on GitHub
Forks: 10 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 26 days ago

    Loading...
    Readme
    Loading...