# map3

### JobResultOption.map3

Namespace: `FsToolkit.ErrorHandling`

Function Signature:

```fsharp
('a -> 'b -> 'c -> 'd)
  -> Job<Result<'a option, 'e>>
  -> Job<Result<'b option, 'e>>
  -> Job<Result<'c option, 'e>>
  -> Job<Result<'d option, 'e>>
```

### Examples

Note: Many use-cases requiring `map3` can also be solved using [the `jobResultOption` computation expression](/fstoolkit-errorhandling/fstoolkit.errorhandling.jobresult/jobresultoption/ce.md).

#### Example 1

Given the following functions:

```fsharp
getUserById : UserId -> Job<Result<User option, exn>>
getPostById : PostId -> Job<Result<Post option, exn>>
getCommentById : CommentId -> Job<Result<Comment option, exn>>
```

And a combining function:

```fsharp
let combine user post comment = (user, post, comment)
```

We can combine all three using `JobResultOption.map3`:

```fsharp
// Job<Result<(User * Post * Comment) option, exn>>
JobResultOption.map3
  combine
  (getUserById sampleUserId)
  (getPostById samplePostId)
  (getCommentById sampleCommentId)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling.jobresult/jobresultoption/map3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
