MonadicTypes.NET.Effects
0.3.0-preview.1
See the version list below for details.
dotnet add package MonadicTypes.NET.Effects --version 0.3.0-preview.1
NuGet\Install-Package MonadicTypes.NET.Effects -Version 0.3.0-preview.1
<PackageReference Include="MonadicTypes.NET.Effects" Version="0.3.0-preview.1" />
<PackageVersion Include="MonadicTypes.NET.Effects" Version="0.3.0-preview.1" />
<PackageReference Include="MonadicTypes.NET.Effects" />
paket add MonadicTypes.NET.Effects --version 0.3.0-preview.1
#r "nuget: MonadicTypes.NET.Effects, 0.3.0-preview.1"
#:package MonadicTypes.NET.Effects@0.3.0-preview.1
#addin nuget:?package=MonadicTypes.NET.Effects&version=0.3.0-preview.1&prerelease
#tool nuget:?package=MonadicTypes.NET.Effects&version=0.3.0-preview.1&prerelease
MonadicTypes.NET.Effects
Explicit exception-to-error boundaries and throwing-operation helpers for
MonadicTypes.NET. This package includes MonadicTypes.NET transitively.
Requirements
- .NET 10 or later
- Compatible with trimming and NativeAOT
Install
dotnet add package MonadicTypes.NET.Effects --prerelease
Quick Start
using MonadicTypes;
using MonadicTypes.Effects;
Result<string, string> text = Effect.Try(
static () => File.ReadAllText("settings.json"),
static exception => $"Read failed: {exception.Message}");
Result<int, string> length = text.TryMap(
static value => value.Length,
static exception => $"Mapping failed: {exception.Message}");
Boundary Rules
Effect.Try,TryAsync, andTryTaskAsyncstart a Result pipeline around throwing code.TryMap,TryBind, andTryTapprotect one stage in an existing pipeline.- Broad overloads exclude cancellation and process-corrupting/runtime failures.
- Typed overloads convert only the selected exception type; other exceptions propagate normally.
- The caller owns exception-to-domain-error mapping.
Catch exceptions at narrow dependency boundaries, then return to ordinary Result composition. Do not wrap an entire application or hide programmer bugs inside a generic unexpected error.
Caller-state overloads avoid closure allocation. Completed async paths avoid an adapter Task allocation, but this package cannot remove allocations made by the underlying dependency.
Related Packages
| Package | Add it for |
|---|---|
MonadicTypes.NET.Errors |
Structured errors that retain exception causes |
MonadicTypes.NET.Async |
Continuing the resulting async pipeline |
Documentation
See exception boundaries.
Apache-2.0. Developed with AI assistance.
Documented public members: 15
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- MonadicTypes.NET (>= 0.3.0-preview.1)
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.3.0-preview.2 | 45 | 9/12/2026 |
| 0.3.0-preview.1 | 43 | 9/12/2026 |
| 0.2.0-preview.2 | 62 | 8/30/2026 |
| 0.2.0-preview.1 | 73 | 8/17/2026 |
| 0.1.0-preview.1 | 66 | 8/12/2026 |