Beispiel #1
0
 public static IObservable <B> MatchObservable <A, B>(this Option <A> ma, Func <A, IObservable <B> > Some, Func <IObservable <B> > None) =>
 ma.IsSome
         ? Some(ma.Cast()).Select(CheckNullSomeReturn)
         : None().Select(CheckNullNoneReturn);
Beispiel #2
0
 public static IObservable <A> ToObservable <A>(this Option <A> ma) =>
 ma.IsSome
         ? Observable.Return(ma.Cast())
         : Observable.Empty <A>();
 public Option <R> Map <R>(Func <T, R> mapper) =>
 IsSome
         ? Option.Cast <R>(mapper(Value))
         : Option <R> .None;