That can be made even simpler in C#:
var blah = () => "im a function";
var blah = () => "im a function";
The fact that, for instance, you can use ES6 modules, and it will be converted to whichever module loading system you're actually using (AMD or Browserify, for instance), means that our code is actually more portable now (our React/Flux/browseify app may well have to be integrated into a project that uses backbone/AMD soon, so that's no longer a headache.
Func<string> blah = () => "im a function";
var blah = new Func<string>(() => "im a function");But you can have a generic extension method that returns one of the types and then via inference you can do it implicitly typed.
It shoud be something like this in C# 5:
public static class Lamb
{
public static Func<T> da(this Func<T> f)
{
return f;
}
}
and then: var egocentricFn = Lamb.da(() => "im a function");
I find it really useful not for Func's but for Expressions, as the type declarations can get pretty long.string blah() => "im a function";
Ceylon:
String blah() => "im a function";
Coincidence? Just kidding.