XNetEx.Functions
0.8.0
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.6.1
This package targets .NET Framework 4.6.1. The package is compatible with this framework or higher.
dotnet add package XNetEx.Functions --version 0.8.0
NuGet\Install-Package XNetEx.Functions -Version 0.8.0
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="XNetEx.Functions" Version="0.8.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XNetEx.Functions" Version="0.8.0" />
<PackageReference Include="XNetEx.Functions" />
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 XNetEx.Functions --version 0.8.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XNetEx.Functions, 0.8.0"
#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 XNetEx.Functions@0.8.0
#: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=XNetEx.Functions&version=0.8.0
#tool nuget:?package=XNetEx.Functions&version=0.8.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FunctionEx
Provides function operator extensions for .NET platform. Including function composition, partial application and pipeline operators.
NOTE: This is not a full port of the functional programming paradigm, but rather aims to provide functional manipulation primitives for .NET delegates. All features are built around extending delegates and do not introduce any new abstractions.
Core Operators
| Operator | Functional Concept | Example Usage | Mathematical Logic |
|---|---|---|---|
Compose |
Backward Composition | f.Compose(g)(x) |
$f(g(x))$ |
Then |
Forward Composition | f.Then(g)(x) |
$g(f(x))$ |
Invoke |
Partial Application | f.Invoke(a, __, c) |
$f'(b) = f(a, b, c)$ |
Apply |
Pipe Operator | x.Apply(f) |
$f(x)$ |
Do |
Tee Pipe Operator | x.Do(log) |
$log(x), x$ |
Prelude
Recommended for global usability:
global using XNetEx.Functions;
global using static XNetEx.Functions.CoreFunctions;
global using static XNetEx.Functions.Placeholder;
Or in *.*proj files:
<ItemGroup>
<Using Include="XNetEx.Functions" />
<Using Include="XNetEx.Functions.CoreFunctions" Static="true" />
<Using Include="XNetEx.Functions.Placeholder" Static="true" />
</ItemGroup>
Usage
// Function composition
// Backward composition
var not = Not;
var equals = Equals<int>;
var notEquals = not.Compose(equals);
var neResult = notEquals(1, 2); // true
// Forward composition
var parse = (Func<string, int>)int.Parse;
var parseThenToString = parse.Then(ToString<int>);
var convertResult = parseThenToString("123"); // "123"
// Partial application
var dict = new Dictionary<int, string>();
var dictAdd = dict.Add;
var reqValue = dictAdd.Invoke(7); // By omitting rest parameters
var reqKey = dictAdd.Invoke(__, "42"); // By a placeholder
reqValue.Invoke("7");
reqKey.Invoke(42);
// dict: { [7] = "7", [42] = "42" }
// Pipeline operators
var result = "123"
.Do(Console.WriteLine) // Apply and pass through
.Apply(int.Parse) // Apply and pass the return value
.Apply(value => (value, 123)) // Prepare two values as a tuple
.Apply(Equals<int>); // Unpack tuple into binary function
// result: true
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.1
- System.ValueTuple (>= 4.4.0)
-
.NETFramework 4.7.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net8.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.8.0 | 62 | 4/5/2026 |