Skip to content
| Marketplace
Sign in
Visual Studio>Tools>C# Union Types
C# Union Types

C# Union Types

John Azariah

|
241 installs
| (1) | Free
Parser and Code-Generator for DU types in C#
Download

This is a DSL, Parser and Code-Generator to specify DU Types in C#.

Use "CSharpUnionTypeGenerator" as the custom tool to process files containing DU specifications.

A typical file looks like this:

 

namespace CoolMonads
{
union Maybe<T> { None | Some<T> };
}

 

The tool will generate a C# code-behind file with a class named Maybe<T> with appropriate behaviour and value semantics.

Notes:

  • Comments are not yet supported

 

The source code is available at https://github.com/johnazariah/csharp-uniontypes

Follow the tutorial at https://johnazariah.github.io/csharp-uniontypes/tutorial.html

 

Pull-Requests and Issues are welcome.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft