I read that C# lambdas can be imlicitly converted to Action or Func , but lambda cannot be executed directly Define a lambda function and execute it immediately For example :
int n = (()=>5)(); //doesn't work
int n = ((Func<int>)(()=>5))(); //works
So what is the actual type of lambda and why it cannot be directly called? Is it because C# type system is "weaker" than Haskell or Scala one?
Dim n = Function() 5
works just fine in VB.NET, and it's similar in F#, and they have the same underlying type system. This is just an issue with C#. – Spitsbergen