Consider a delegate declaration which takes a function and returns another function:
delegate Func<int, int> FuncConversionDelegate( Func<int, int> Func );
Your goal is to write a lambda expression defining a converter which would negate values returned by original method:
FuncConversionDelegate Negation =
/* replace this with a lambda expression which takes function f and returns function g so that g(x) = -f(x) */;Specifically, you have to replace the commented expression above to a correct definition.
To test the converter, take the identity function:
static Func<int, int> Identity = x => x;
and apply Negation to it:
Negation( Identity )( 5 )