Exemplo n.º 1
0
 public static Arr <Option <B> > Traverse <A, B>(this Option <Arr <A> > ma, Func <A, B> f) =>
 ma.Match(
     None: () => Array(Option <B> .None),
     Some: xs => xs.Map(x => Some(f(x))));
Exemplo n.º 2
0
 public static IEnumerable <Option <B> > Traverse <A, B>(this Option <IEnumerable <A> > ma, Func <A, B> f) =>
 ma.Match(
     None: () => new[] { Option <B> .None },
     Some: xs => xs.Map(x => Some(f(x))));
Exemplo n.º 3
0
 public static Que <Option <B> > Traverse <A, B>(this Option <Que <A> > ma, Func <A, B> f) =>
 ma.Match(
     None: () => Queue(Option <B> .None),
     Some: xs => xs.Map(x => Some(f(x))));
Exemplo n.º 4
0
 internal static IActorDispatch GetRemoteDispatcher(ProcessId pid) =>
 cluster.Match <IActorDispatch>(
     Some: c => new ActorDispatchRemote(pid, c),
     None: () => new ActorDispatchNotExist(pid));
Exemplo n.º 5
0
 public static Unit match <T>(Option <T> option, Action <T> Some, Action None) =>
 option.Match(Some, None);
Exemplo n.º 6
0
 public static Stck <Option <B> > Traverse <A, B>(this Option <Stck <A> > ma, Func <A, B> f) =>
 ma.Match(
     None: () => Stack(Option <B> .None),
     Some: xs => xs.Map(x => Some(f(x))));
Exemplo n.º 7
0
 public static R match <T, R>(Option <T> option, Func <T, R> Some, Func <R> None) =>
 option.Match(Some, None);
Exemplo n.º 8
0
 public static Lst <Option <B> > Traverse <A, B>(this Option <Lst <A> > ma, Func <A, B> f) =>
 ma.Match(
     None: () => List(Option <B> .None),
     Some: xs => xs.Map(x => Some(f(x))));
Exemplo n.º 9
0
 internal IActorDispatch GetRemoteDispatcher(ProcessId pid) =>
 cluster.Match <IActorDispatch>(
     Some: c => new ActorDispatchRemote(pid, c, ActorContext.SessionId),
     None: () => new ActorDispatchNotExist(pid));
Exemplo n.º 10
0
 public static Identity <Option <B> > Traverse <A, B>(this Option <Identity <A> > ma, Func <A, B> f) =>
 ma.Match(
     Some: x => new Identity <Option <B> >(f(x.Value)),
     None: () => new Identity <Option <B> >(Option <B> .None));
Exemplo n.º 11
0
 public R Match <R>(Func <A, R> Some, Func <R> None, Func <Exception, R> Fail) =>
 IsFaulted
         ? Fail(Exception ?? BottomException.Default)
         : Value.Match(Some, None);