('a -> 'b -> 'c) -> Task<Result<'a, 'd>> -> Task<Result<'b, 'd>>
-> Task<Result<'c, 'd>>
getFollowerIds : UserId -> Task<Result<UserId list, exn>>
createPost : CreatePostRequest -> Task<Result<PostId, exn>>
type NotifyNewPostRequest =
{ UserIds : UserId list
NewPostId : PostId }
static member Create userIds newPostsId =
{UserIds = userIds; NewPostId = newPostsId}
let createPostAndGetNotifyRequest (req : CreatePostRequest) =
// Task<Result<UserId list, exn>>
let getFollowersResult = getFollowerIds req.UserId
// Task<Result<PostId, exn>>
let createPostResult = createPost req
// Task<Result<NotifyNewPostRequest, exn>>
let newPostRequestResult =
TaskResult.map2
NotifyNewPostRequest.Create getFollowersResult createPostResult
// ...