Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (16 sloc) 370 Bytes

Result.ofChoice

Transforms F#'s Choice value to Result.

Namespace: FsToolkit.ErrorHandling

Function Signature:

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

Examples:

Example 1

Result.ofChoice (Choice1Of2 42) // returns - Ok 42
Result.ofChoice (Choice2Of2 "Something went wrong!") 
// returns - Error "Something went wrong!"