Skip to content

Instantly share code, notes, and snippets.

@mtzaldo
Last active June 24, 2023 07:57
Show Gist options
  • Save mtzaldo/956d9870edbf3f7de92d6c844a616cfd to your computer and use it in GitHub Desktop.
Save mtzaldo/956d9870edbf3f7de92d6c844a616cfd to your computer and use it in GitHub Desktop.
C# map / reduce / filter
Map = Select | Enumerable.Range(1, 10).Select(x => x + 2);
Reduce = Aggregate | Enumerable.Range(1, 10).Aggregate(0, (acc, x) => acc + x);
Filter = Where | Enumerable.Range(1, 10).Where(x => x % 2 == 0);
source: http://stackoverflow.com/a/13895253
@ThierryMonnier
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment