Skip to content

Commit 1aa0154

Browse files
committed
+ ValueOption.ofOption
1 parent c1ebe74 commit 1aa0154

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/FSharpPlus/Extensions/ValueOption.fs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ module ValueOption =
7171
| true, x -> ValueSome x
7272
| false, _ -> ValueNone
7373

74-
let toOption x =
75-
match x with
74+
/// <summary>Converts a ValueOption to an Option.</summary>
75+
let toOption (source: ValueOption<'T>) =
76+
match source with
7677
| ValueSome x -> Some x
7778
| ValueNone -> None
79+
80+
/// <summary>Converts an Option to a ValueOption.</summary>
81+
let ofOption (source: option<'T>) =
82+
match source with
83+
| Some x -> ValueSome x
84+
| None -> ValueNone

0 commit comments

Comments
 (0)