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