> For the complete documentation index, see [llms.txt](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/result/transforms/ofchoice.md).

# ofChoice

Namespace: `FsToolkit.ErrorHandling`

Transforms F#'s `Choice` value to `Result`.

## Function Signature

```fsharp
Choice<'a,'b> -> Result<'a, 'b>
```

## Examples

### Example 1

```fsharp
Result.ofChoice (Choice1Of2 42)
// Ok 42

Result.ofChoice (Choice2Of2 "Something went wrong!") 
// Error "Something went wrong!"
```
