예제 #1
0
 static public ProcessWithLog <LogEntryT, Result <ErrT, NewOkT> > ResultAndThenContinue <LogEntryT, ErrT, OkT, NewOkT>(
     this ProcessWithLog <LogEntryT, Result <ErrT, OkT> > orig,
     Func <OkT, ProcessWithLog <LogEntryT, Result <ErrT, NewOkT> > > andThen) =>
 orig.Continue(previousResult =>
               previousResult.Ok == null ?
               new ProcessWithLog <LogEntryT, Result <ErrT, NewOkT> >(Result: new Result <ErrT, NewOkT>(Err: previousResult.Err)) :
               andThen(previousResult.Ok));
예제 #2
0
 static public ProcessWithLog <LogEntryT, Result <ErrT, NewOkT> > ResultAndThenMap <LogEntryT, ErrT, OkT, NewOkT>(
     this ProcessWithLog <LogEntryT, Result <ErrT, OkT> > orig,
     Func <OkT, Result <ErrT, NewOkT> > andThen) =>
 orig.MapResult(previousResult =>
                previousResult.Ok == null ?
                new Result <ErrT, NewOkT>(Err: previousResult.Err) :
                andThen(previousResult.Ok));
예제 #3
0
 static public ProcessWithLog <LogEntryT, Result <ErrT, OkT> > ResultAddLogEntryIfOk <LogEntryT, ErrT, OkT>(
     this ProcessWithLog <LogEntryT, Result <ErrT, OkT> > orig,
     Func <OkT, LogEntryT> addLogEntry) =>
 ResultAndThenContinue(
     orig,
     ok => new ProcessWithLog <LogEntryT, Result <ErrT, OkT> >(
예제 #4
0
 static public ProcessWithLog <LogEntryT, Result <ErrT, NewOkT> > ResultMapContinue <LogEntryT, ErrT, OkT, NewOkT>(
     this ProcessWithLog <LogEntryT, Result <ErrT, OkT> > orig,
     Func <OkT, ProcessWithLog <LogEntryT, NewOkT> > map) =>
 orig.ResultAndThenContinue(previousOk => map(previousOk).MapResult(newOk => new Result <ErrT, NewOkT>(Ok: newOk)));
예제 #5
0
 static public ProcessWithLog <LogEntryT, Result <ErrT, NewOkT> > ResultMap <LogEntryT, ErrT, OkT, NewOkT>(
     this ProcessWithLog <LogEntryT, Result <ErrT, OkT> > orig,
     Func <OkT, NewOkT> map) =>
 orig.ResultAndThenMap(previousResult => new Result <ErrT, NewOkT>(Ok: map(previousResult)));