Unio.Extensions
0.7.28
Requires NuGet 2.12 or higher.
dotnet add package Unio.Extensions --version 0.7.28
NuGet\Install-Package Unio.Extensions -Version 0.7.28
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.Extensions" Version="0.7.28" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Unio.Extensions" Version="0.7.28" />
<PackageReference Include="Unio.Extensions" />
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.Extensions --version 0.7.28
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Unio.Extensions, 0.7.28"
#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.Extensions@0.7.28
#: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.Extensions&version=0.7.28
#tool nuget:?package=Unio.Extensions&version=0.7.28
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Unio.Extensions
Functional and fluent extensions for Unio<T0, T1> with allocation-conscious APIs and ValueTask-based async composition.
Features
- Branch mapping:
MapT0,MapT1,BindT0,BindT1 - Async branch mapping:
BindT0Async,BindT1Async(ValueTask) - Side-effects:
TapT0,TapT1,TapT0Async,TapT1Async - Recovery:
RecoverT0,RecoverT1 - Validation guards:
EnsureT0,EnsureT1 - Folding:
Fold,FoldAsync(ValueTask) - Branch observation:
OnT0,OnT1 - TryPick helpers:
PickT0Or,PickT1Or - Dual mapping:
BiMap - LINQ support:
Select,SelectMany - Result bridges:
ToResult,FromResult
Quick Start
using Unio;
using Unio.Extensions;
Unio<int, string> value = "invalid";
int normalized = value
.TapT1(static error => Console.WriteLine(error))
.EnsureT1(static e => e.Length < 20, static _ => -1)
.RecoverT1(static _ => -1);
ValueTask Async Pipeline
using Unio;
using Unio.Extensions;
Unio<int, string> value = 21;
Unio<double, string> result = await value
.BindT0Async(static i => ValueTask.FromResult(i * 2.0))
.TapT0Async(static d =>
{
Console.WriteLine($"computed: {d}");
return ValueTask.CompletedTask;
});
LINQ Query Syntax
using Unio;
using Unio.Extensions;
Unio<int, string> left = 4;
Unio<int, string> sum =
from x in left
from y in (Unio<int, string>)(x * 3)
select x + y;
Result Bridge
using Unio;
using Unio.Extensions;
using Unio.Types;
Unio<int, string> value = 42;
Unio<Result<int>, Error<string>> wrapped = value.ToResult();
Unio<int, string> roundtrip = wrapped.FromResult();
| Product | Versions 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
- Unio (>= 0.7.28)
- Unio.Types (>= 0.7.28)
-
net8.0
- Unio (>= 0.7.28)
- Unio.Types (>= 0.7.28)
-
net9.0
- Unio (>= 0.7.28)
- Unio.Types (>= 0.7.28)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.28 | 36 | 3/3/2026 |