public static Func <T, IPromise <ControlValue <E> > > Canonical <T, E>(this PromiseFactory factory, Func <T, IPromise <NullableResult <E> > > fn) { return(factory.Canonical <T, E>(x => factory.SafeThen(fn(x), result => { if (result == null || !result.HasResult) { return ControlValue <E> .Next; } return ControlValue <E> .Return(result.Result); }))); }
public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Action <T> fn) { return(factory.Canonical <T>(fn.ReturnPromise(factory))); }
public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Func <T, IPromise> fn) { return(factory.Canonical <T, object>(x => factory.SafeThen(fn(x), () => ControlValue <object> .Next))); }
public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Func <T, ControlState> fn) { return(factory.Canonical <T, object>(x => factory.Value(fn(x)))); }
public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Func <T, IPromise <ControlState> > fn) { return(factory.Canonical <T, object>(x => factory.SafeThen(fn(x), result => new ControlValue <object>(result)))); }
public static Func <T, IPromise <ControlValue <E> > > Canonical <T, E>(this PromiseFactory factory, Func <T, E> fn) { return(factory.Canonical <T, E>(x => factory.Value(fn(x)))); }
public static Func <T, IPromise <ControlValue <E> > > Canonical <T, E>(this PromiseFactory factory, Func <T, IPromise <E> > fn) { return(factory.Canonical <T, E>(x => factory.SafeThen(fn(x), result => ControlValue <E> .Return(result)))); }
public static Func <IPromise <ControlValue <object> > > Canonical(this PromiseFactory factory, Action fn) { return(factory.Canonical <object>(fn)); }
public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <ControlState> fn) { return(factory.Canonical <T>(() => factory.Value(fn()))); }
public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <IPromise> fn) { return(factory.Canonical <T>(() => factory.SafeThen(fn, () => ControlState.Next))); }
public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <IPromise <ControlState> > fn) { return(factory.Canonical(() => factory.SafeThen(fn, result => new ControlValue <T>(result)))); }
public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <NullableResult <T> > fn) { return(factory.Canonical(() => factory.Value(fn()))); }
public Scope <T> Run(Func <ControlValue <T> > action) { return(Run(_factory.Canonical(action))); }
public IPromise <ControlValue <T> > Do <T>(Func <ControlValue <T> > body) { return(Do(_factory.Canonical(body))); }
public For <T> Iterate(Func <T, ControlValue <T> > iterator) { return(Iterate(_factory.Canonical(iterator))); }