Example #1
0
        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));
        }
Example #2
0
 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>));
 }
Example #3
0
 public static Optional <T> Of <T>(T value)
 {
     return((object)value == null?None.Of <T>() : Some.Of(value));
 }