public static void Main()
Func<bool, bool?> processor = x => !x;
bool a = Process(false, processor);
bool b = Process<bool, bool>(false, x => !x);
bool c = Process(false, x => !x);
Program d = Process(new Program(), x => x);
bool e = Process<bool, bool>(false, x => x ? x : null);
bool f = Process(false, x => x ? x : null);
public static TResult Process<TInput, TResult>(TInput input, Func<TInput, TResult?> processor)
return processor(input) ?? throw new Exception();
public static TResult Process<TInput, TResult>(TInput input, Func<TInput, TResult?> processor)
return processor(input) ?? throw new Exception();