Skip to content

Instantly share code, notes, and snippets.

@math314
Created July 31, 2013 10:36
Show Gist options
  • Select an option

  • Save math314/6121018 to your computer and use it in GitHub Desktop.

Select an option

Save math314/6121018 to your computer and use it in GitHub Desktop.
public class TupleFunc
{
public static Func<Tuple<T1, T2>, TResult> Create<T1, T2, TResult>(Func<T1, T2, TResult> f)
{
return new Func<Tuple<T1, T2>, TResult>(t => f(t.Item1, t.Item2));
}
}
public static Main{
static void Main()
{
var f = TupleFunc.Create((string s, int x) => s.Length == x);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment