Skip to content

Commit

Permalink
+ ValueOption.ofOption
Browse files Browse the repository at this point in the history
  • Loading branch information
gusty committed Oct 6, 2023
1 parent c1ebe74 commit 6aadd64
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/FSharpPlus/Extensions/ValueOption.fs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ module ValueOption =
| true, x -> ValueSome x
| false, _ -> ValueNone

let toOption x =
match x with
/// <summary>Converts a ValueOption to an Option.</summary>
let toOption (source: ValueOption<'T>) =
match source with
| ValueSome x -> Some x
| ValueNone -> None

/// <summary>Converts an Option to a ValueOption.</summary>
let ofOption (source: option<'T>) =
match x with

Check failure on line 82 in src/FSharpPlus/Extensions/ValueOption.fs

View workflow job for this annotation

GitHub Actions / testFable3SubsetOnCore

The value or constructor 'x' is not defined.
| Some x -> ValueSome x
| None -> ValueNone

0 comments on commit 6aadd64

Please sign in to comment.