Unio.Types 0.7.12

Requires NuGet 2.12 or higher.

dotnet add package Unio.Types --version 0.7.12
                    
NuGet\Install-Package Unio.Types -Version 0.7.12
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Unio.Types" Version="0.7.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Unio.Types" Version="0.7.12" />
                    
Directory.Packages.props
<PackageReference Include="Unio.Types" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Unio.Types --version 0.7.12
                    
#r "nuget: Unio.Types, 0.7.12"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Unio.Types@0.7.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Unio.Types&version=0.7.12
                    
Install as a Cake Addin
#tool nuget:?package=Unio.Types&version=0.7.12
                    
Install as a Cake Tool

Unio.Types

Pre-built, high-performance sentinel and value types for use with Unio discriminated unions.

Usage

using Unio;
using Unio.Types;

// Use marker types in discriminated unions
Unio<User, NotFound> GetUser(int id) => ...;
Unio<Order, Forbidden, NotFound> GetOrder(int id) => ...;
Unio<Success, ValidationError> Validate(Request req) => ...;

// Use value-carrying types for rich results
Unio<Success<Order>, Error<string>> CreateOrder(OrderRequest req) => ...;
Unio<Created<int>, ValidationError<string[]>> SaveUser(UserDto dto) => ...;

Included Types

Markers (empty sentinel structs)

Yes, No, Maybe, True, False, Unknown, All, Some, None, Empty, Pending, Cancelled, Timeout, Skipped, Invalid, NotFound, Forbidden, Unauthorized, Conflict, BadRequest, Accepted, NoContent, Created, Updated, Deleted, Unchanged, Success, Error, Disabled, Expired, RateLimited

Value Carriers (structs with Value property)

Success<T>, Error<T>, Result<T>, NotFound<T>, Created<T>, Updated<T>, ValidationError (string Message), ValidationError<T>

All types are readonly struct with IEquatable<T>, ==/!= operators and AggressiveInlining on hot paths.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Unio.Types:

Package Downloads
Unio.AspNetCore

Unio provides high-performance, struct-based discriminated unions for C#. Zero-allocation, exhaustive matching, Match, Switch and TryGet patterns and full value semantics. Simple, performant and scalable.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.12 22 3/2/2026
0.7.1 35 3/1/2026