Created
May 5, 2020 06:22
-
-
Save aemloviji/4512e8accc1c31548d56c3d4c968e018 to your computer and use it in GitHub Desktop.
Higher-order function in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
Func<int, int> doubleCall(Func<int, int> func) => x => func(func(x)); | |
static int plusN(int n) => n + 3; | |
Console.WriteLine(doubleCall(plusN)(5)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment