意外に簡単にできたので。
public static class FuncUtils
{
public static Func<T0, T2> Compose<T0,T1,T2>(
this Func<T0, T1> f0, Func<T1, T2> f1)
{
Expression<Func<T0, T2>> ret = t0 => f1(f0(t0));return ret.Compile();
}
}
これで、また幸せライフの始まりだぜ!
意外に簡単にできたので。
public static class FuncUtils
{
public static Func<T0, T2> Compose<T0,T1,T2>(
this Func<T0, T1> f0, Func<T1, T2> f1)
{
Expression<Func<T0, T2>> ret = t0 => f1(f0(t0));return ret.Compile();
}
}
これで、また幸せライフの始まりだぜ!
Tags: