public static Task <IOption <UserMessage> > MapToUserMessageAsync <A>(this ITry <Task <A> > aTry, Func <A, IOption <UserMessage> > mapper)
 {
     return(aTry.Match(r => r.Map(mapper), e => Task.FromResult(Option.Create(UserMessage.Error(e)))));
 }
 public static IOption <UserMessage> MapToUserMessage <A>(this ITry <A> aTry, Func <A, IOption <UserMessage> > mapper)
 {
     return(aTry.Match(mapper, e => Option.Create(UserMessage.Error(e))));
 }
예제 #3
0
 public static Monad.Reader <Environment, Task <ApiResult <SignUpResponse> > > Post(SignUpRequest request) =>
 Post <SignUpRequest, SignUpResponse>(request, "/signUp", Option.Empty <AccessToken>());