PipeEx.StructuredConcurrency 0.1.0-alpha.1

This is a prerelease version of PipeEx.StructuredConcurrency.
dotnet add package PipeEx.StructuredConcurrency --version 0.1.0-alpha.1
                    
NuGet\Install-Package PipeEx.StructuredConcurrency -Version 0.1.0-alpha.1
                    
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="PipeEx.StructuredConcurrency" Version="0.1.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PipeEx.StructuredConcurrency" Version="0.1.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="PipeEx.StructuredConcurrency" />
                    
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 PipeEx.StructuredConcurrency --version 0.1.0-alpha.1
                    
#r "nuget: PipeEx.StructuredConcurrency, 0.1.0-alpha.1"
                    
#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.
#addin nuget:?package=PipeEx.StructuredConcurrency&version=0.1.0-alpha.1&prerelease
                    
Install PipeEx.StructuredConcurrency as a Cake Addin
#tool nuget:?package=PipeEx.StructuredConcurrency&version=0.1.0-alpha.1&prerelease
                    
Install PipeEx.StructuredConcurrency as a Cake Tool

PipeEx

.NET NuGet NuGet

PipeEx 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.

Table of Contents

Features

  • Fluent Syntax: Create readable chains of function calls.
  • Asynchronous Support: Seamlessly chains both synchronous and asynchronous operations (Task<T>).
  • Simplified Code: Reduces nesting and complexity, making your code easier to maintain.
  • Lightweight: No dependencies without compromising on expressiveness.

Installation

Install PipeEx via NuGet:

dotnet add package PipeEx

For Structured Concurrency support, install:

dotnet add package PipeEx.StructuredConcurrency

Usage

Synchronous Operations

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);

Asynchronous Operations

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);

Planned Features

  • Structured Concurrency: Declare asynchronous variables that are resolved at a later point.
  • Cancellation: Support for initializing and propagating cancellation tokens (e.g., StructuredTask<T>).
  • Resource Management: Enhanced handling for resources that are not thread-safe (like EF Core DbContext or WPF UI updates).

Contributing

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.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

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.1.0-alpha.1 228 3/23/2025
0.0.9 129 3/17/2025
0.0.8 128 3/12/2025
0.0.7 153 3/9/2025
0.0.6 208 3/7/2025
0.0.5 193 3/6/2025
0.0.4 88 3/2/2025
0.0.3 89 2/28/2025