Functional programming in C#