public static bool TestCompositionAssociativity() { var arrf = new Func <int, int>(x => x * 9 - 3).Arr((int y) => (y + 3) / 9); var arrg = new Func <int, int>(x => x + 1).Arr((int y) => y - 1); var arrh = new Func <int, int>(x => x * 5).Arr((int y) => y / 5); var f_gh = arrf.Combine(arrg.Combine(arrh)); var fg_h = (arrf.Combine(arrg)).Combine(arrh); return(ArrowTestUtils.AssertInvertibleArrowsGiveSameOutput(f_gh, fg_h)); }
public static bool TestCompositionAssociativity() { var arrf = new Func<int, int>(x => x * 9 - 3).Arr((int y) => (y + 3) / 9); var arrg = new Func<int, int>(x => x + 1).Arr((int y) => y - 1); var arrh = new Func<int, int>(x => x * 5).Arr((int y) => y / 5); var f_gh = arrf.Combine(arrg.Combine(arrh)); var fg_h = (arrf.Combine(arrg)).Combine(arrh); return ArrowTestUtils.AssertInvertibleArrowsGiveSameOutput(f_gh, fg_h); }
public void OnNextElement(Func <TContext, LambdaStep <TContext>, StepId> func) { _onNextElement = _onNextElement.Combine(func); }
public TConfig WithCustomization(Func <Props, Props> custom) { Custom = Custom.Combine(custom); return((this as TConfig) !); }
public void OnExecute(Func <TContext, LambdaStep <TContext>, StepId> func) { _onExecute = _onExecute.Combine(func); }