Skip to content

Instantly share code, notes, and snippets.

@ythirion
Created December 18, 2019 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ythirion/fef78c0f4dfc85159eefd2a9afd65ae4 to your computer and use it in GitHub Desktop.
Save ythirion/fef78c0f4dfc85159eefd2a9afd65ae4 to your computer and use it in GitHub Desktop.
partial app
static Func<int, int, int> Multiply = (a, b) => a * b;
static Func<int, int> TwoTimes = par(Multiply, 2);
[Fact]
public void partial_app_example()
{
Multiply(3, 4); // 12
TwoTimes(9); // 18
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment