mapError

AsyncResult.mapError

Namespace: FsToolkit.ErrorHandling

Function Signature:

('a -> 'b) -> Async<Result<'c, 'a>> -> Async<Result<'c, 'b>>

Examples

Example 1

From the AsyncResult.map example, if we want to map the error part alone, we can do it as below:

// Async<Result<PostId>, string>
createPost createPostRequest
|> AsyncResult.mapError (fun (ex : exn) -> ex.Message)

Last updated