OpFlow 1.0.6.3
dotnet add package OpFlow --version 1.0.6.3
NuGet\Install-Package OpFlow -Version 1.0.6.3
<PackageReference Include="OpFlow" Version="1.0.6.3" />
<PackageVersion Include="OpFlow" Version="1.0.6.3" />
<PackageReference Include="OpFlow" />
paket add OpFlow --version 1.0.6.3
#r "nuget: OpFlow, 1.0.6.3"
#:package OpFlow@1.0.6.3
#addin nuget:?package=OpFlow&version=1.0.6.3
#tool nuget:?package=OpFlow&version=1.0.6.3
OpFlow
A minimal, expressive pipeline framework for C#.
OpFlow provides a clean, predictable way to compose operations in C#.
It centers around a single abstraction — Operation<T> — representing either:
- a successful result, or
- a failed result with a structured
Error.
No magic. No hidden behavior. No alternative syntaxes.
Just a crisp transform canon for building narrative‑driven pipelines.
Why OpFlow?
C# applications often accumulate:
- scattered error handling
- inconsistent validation
- deeply nested
try/catchblocks - ad‑hoc null checks
- unpredictable async flows
OpFlow solves this by giving you:
- One canonical way to compose operations
- One predictable error model
- One narrative for how data flows through your system
Everything is explicit.
Everything is discoverable.
Everything is composable.
The Core Abstraction: Operation<T>
An Operation<T> is either:
Success(T result)
Failure(Error error)
This shape is the foundation of OpFlow’s transform canon.
The Transform Canon
OpFlow defines a small, intentional set of operators:
Map— transform a successful valueBind— chain dependent operationsMapAsync— async transformBindAsync— async chainingTap— observe without modifyingRecover— handle failuresMatch— unify success/failureFinally— run cleanup logic
These operators live on Operation<T> itself to ensure a single canonical implementation.
The Op Façade
Op is the recommended entry point for creating operations:
Op.Success(value)
Op.Failure<T>(error)
Op.From(value)
Op.From(func)
Op.FromAsync(func)
Op.FromException<T>(ex)
Op.Try(func)
Op.TryAsync(func)
These helpers wrap raw values, exceptions, and tasks into operations so your pipeline can begin cleanly.
Validation
Validation is a first‑class part of the transform canon:
Operation.Validate(...)
Operation.ValidateAll(...)
Operation.ValidateAsync(...)
Operation.ValidateAllAsync(...)
These operators aggregate multiple operations into one, collecting errors when needed.
Example
var result =
Op.From(() => File.ReadAllText("config.json"))
.Map(ParseConfig)
.Bind(ValidateConfig)
.BindAsync(SaveConfigAsync)
.Tap(_ => Log("Config saved"))
.Recover(error => LogError(error))
.Match(
onSuccess: _ => "OK",
onFailure: error => $"Failed: {error.Message}"
);
This is the OpFlow story:
- clear
- sequential
- explicit
- readable
Installation
dotnet add package OpFlow
Design Principles
- One way to do things — no LINQ sugar, no parallel sugar, no duplicates
- Explicit over implicit — every step is visible
- Narrative‑driven pipelines — code that reads like a story
- Minimal surface area — a small API is a powerful API
License
MIT
| 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OpFlow:
| Package | Downloads |
|---|---|
|
OpFlow.Converters.NewtonsoftJson
Newtonsoft.Json converters for OpFlow discriminated unions. |
GitHub repositories
This package is not used by any popular GitHub repositories.