Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JasonBock/PartiallyApplied
Partial function application in C#
https://github.com/JasonBock/PartiallyApplied
Last synced: 2 days ago
JSON representation
Partial function application in C#
- Host: GitHub
- URL: https://github.com/JasonBock/PartiallyApplied
- Owner: JasonBock
- License: mit
- Created: 2020-12-31T20:20:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T18:51:34.000Z (almost 2 years ago)
- Last Synced: 2024-11-03T07:38:15.216Z (7 days ago)
- Language: C#
- Size: 94.7 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
- RSCG_Examples - https://github.com/JasonBock/PartiallyApplied
README
# PartiallyApplied
A way to do partial function application in C#.
## Overview
You can find this code as a package in [NuGet](https://www.nuget.org/packages/PartiallyApplied/). Once installed, you can use it to do partial function application:
```
public static class Maths
{
public static int Add(int a, int b) => a + b;
}public static class Runner
{
public static void Run()
{
var incrementBy3 = Partially.Apply(Maths.Add, 3);
var value = incrementBy3(4);
// value is now equal to 7.
}
}
```
More details can be found on the [Quickstart page](https://github.com/JasonBock/PartiallyApplied/blob/main/docs/Quickstart.md). Note that if you build the code locally, you'll need to build in `Release` mode for the package reference in `PartiallyApplied.NuGetHost` to resolve correctly (or unload that project from the solution as it's optional and delete `nuget.config`).