Package Description
$ dotnet add package PipeEx.StructuredConcurrencyPipeEx is a lightweight C# library that enables fluent, pipe-like function chaining. By leveraging the I (Infer) extension method, you can pass the result of one function directly into the next, resulting in cleaner and more maintainable code.
Task<T>).Install PipeEx via NuGet:
dotnet add package PipeEx
For Structured Concurrency support, install:
dotnet add package PipeEx.StructuredConcurrency
The core feature of PipeEx is the I extension method. It lets you pipe the output of one function as the input to the next:
public int Calc(int x) => x.I(FuncY)
.I(x => x + 2);
You can also automatically destructure tuples:
public int Calc(int x) => x.I(x => (x + 2, x + 4))
.I((x, y) => x + y);
PipeEx supports chaining asynchronous operations. The library automatically handles awaiting tasks:
// awaiting is handled automatically
public Task<int> Calc(int x) => x.I(FuncXAsync)
.I(x => x + 2)
.I(FuncYAsync)
.I(FuncY);
Contributions are welcome! If you would like to submit improvements, please fork the repository and open a pull request. For major changes, please open an issue first to discuss what you would like to change.