public static IEnumerable <T> ExploreSequence <T>(T initial, T endCondition, Func <T, T> next) { if (next == null) { throw new ArgumentNullException(nameof(next)); } return(ExploreSequenceExtracted(initial, endCondition, next, FuncHelper.GetIdentityFunc <T>(), null)); }
public static IEnumerable <T> ExploreBreadthFirstTree <T>(IEnumerable <T> initial, Func <T, IEnumerable <T> > next) { if (next == null) { throw new ArgumentNullException(nameof(next)); } var branches = initial; return(ExploreBreadthFirstTreeExtracted(branches, next, FuncHelper.GetIdentityFunc <T>())); }
public static IEnumerable <T> ExploreBreadthFirstGraph <T>(IEnumerable <T> initial, Func <T, IEnumerable <T> > next, IEqualityComparer <T> comparer) { if (next == null) { throw new ArgumentNullException(nameof(next)); } var branches = initial; return(ExploreBreadthFirstGraphExtracted(branches, next, FuncHelper.GetIdentityFunc <T>(), comparer ?? EqualityComparer <T> .Default)); }
public ValueFuncClosure(Func <TReturn> target) { _result = default(TReturn); _target = target ?? FuncHelper.GetDefaultFunc <TReturn>(); }
public static Func <TReturn> GetDefault <TReturn>() { return(FuncHelper.GetDefaultFunc <TReturn>()); }
public static TReturn Default <TReturn>() { return(FuncHelper.GetDefaultFunc <TReturn>().Invoke()); }
public static IEnumerable <T> ExploreBreadthFirstTree <T>(IEnumerable <T> initial, Func <T, IEnumerable <T> > next) { var branches = initial; return(ExploreBreadthFirstTreeExtracted(branches, next, FuncHelper.GetIdentityFunc <T>())); }
public static IEnumerable <T> ExploreBreadthFirstGraph <T>(T initial, Func <T, IEnumerable <T> > next) { var branches = new[] { initial }; return(ExploreBreadthFirstGraphExtracted(branches, next, FuncHelper.GetIdentityFunc <T>())); }
public ErsatzFunc(Func <TReturn> target) { _result = default(TReturn); _target = target ?? FuncHelper.GetDefaultFunc <TReturn>(); }