Skip to content

Enums with payloads. Or for the fancy pants: discriminated unions for C# with compile-time exhaustiveness checking, implemented using closed type hierarchies.

License

Notifications You must be signed in to change notification settings

badeend/EnumClass

Repository files navigation

EnumClass

Enums with payloads

Nuget


This is an analyzer-only package that aims to provide a dead simple, yet complete, "discriminated unions" experience for C# with compile-time exhaustiveness checking.

More information on the project website: https://badeend.github.io/EnumClass/


Shameless self-promotion

May I interest you in one of my other packages?

  • Badeend.ValueCollections: Low overhead immutable collection types with structural equality.
  • Badeend.EnumClass: Discriminated unions for C# with exhaustiveness checking.
  • Badeend.Result: For failures that are not exceptional: Result<T,E> for C#.
  • Badeend.Any: Holds any value of any type, without boxing small structs (up to 8 bytes).
  • Badeend.Nothing: If you want to use void as a type parameter, but C# won't let you.

About

Enums with payloads. Or for the fancy pants: discriminated unions for C# with compile-time exhaustiveness checking, implemented using closed type hierarchies.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project