public static Await <T> Any <T>(params Await <T>[] sources) { var ignored = default(T); return(Many( (x, i) => Some.Of(x.Success), // if success fails, then we are automatically propagating this error into result Await<T> ignored, sources)); }
public static Optional <R> Map <T, R>(this Optional <T> source, Func <T, R> map) { return(source.Match(x => Some.Of(map(x)), None.Of <R>)); }
public static Optional <T> Of <T>(T value) { return((object)value == null?None.Of <T>() : Some.Of(value)); }