DSL, parser and code-generator for Union Types (discriminated unions/sum types) in C#
F# C# Shell Batchfile
Permalink
Failed to load latest commit information.
.github ProjectScaffold Initialized Oct 30, 2016
.paket
docs
lib ProjectScaffold Initialized Oct 30, 2016
src complete renaming to csharp-uniontypes Jan 14, 2017
tests Include lib and executables in Nuget package in the appropriate folde… Jan 14, 2017
.gitattributes ProjectScaffold Initialized Oct 30, 2016
.gitignore Multiple fixes and cleanup (#11) Jan 11, 2017
.travis.yml
CSharp.UnionTypes.sln Single File Generator and VSIX (#10) Jan 10, 2017
LICENSE.txt Apply MIT License Oct 30, 2016
README.md complete renaming to csharp-uniontypes Jan 14, 2017
RELEASE_NOTES.md Fix documentation and prepare for release (#14) Jan 14, 2017
appveyor.yml ProjectScaffold Initialized Oct 30, 2016
build.cmd ProjectScaffold Initialized Oct 30, 2016
build.fsx complete renaming to csharp-uniontypes Jan 14, 2017
build.sh ProjectScaffold Initialized Oct 30, 2016
paket.dependencies Single File Generator and VSIX (#10) Jan 10, 2017
paket.lock Include lib and executables in Nuget package in the appropriate folde… Jan 14, 2017

README.md

csharp-uniontypes

Get started with using Union Types right within your existing C# Visual Studio Projects!

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 very useful constructs because they can help model the domain of a problem more precisely, and can help eliminate entire classes of runtime bugs.

Languages like C# and Java can build these types using inheritance and a class hierarchy, but the boilerplate required to do this is too onerous for widespread use.

This library presents a language extension to C# to specify Discriminated Union types, and a tool which parses these specifications and generates idiomatic C# classes which provide the correct functionality.

The tool is available both as a command-line utility and a Visual Studio 2015 extension also available from the marketplace.

Follow the tutorial for more detailed instructions.

Build Status

Mono .NET
Mono CI Build Status .NET Build Status

Maintainer(s)