Skip to content

Commit 4ac6a5b

Browse files
gdziadkiewiczTheAngryByrd
authored andcommitted
Add doc for Option.maybe.
1 parent 348e4f2 commit 4ac6a5b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/FsToolkit.ErrorHandling/Option.fs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ module Option =
120120
|> ofNull
121121
| None -> None
122122

123+
/// <summary>
124+
/// Returns result of running <paramref name="onSome"/> if it is <c>Some</c>, otherwise returns result of running <paramref name="onNone"/>
125+
/// </summary>
126+
/// <param name="onNone">The function to run if <paramref name="input"/> is <c>None</c></param>
127+
/// <param name="onSome">The function to run if <paramref name="input"/> is <c>Some</c></param>
128+
/// <param name="input">The input option.</param>
129+
/// <returns>
130+
/// The result of running <paramref name="onSome"/> if the input is <c>Some</c>, else returns result of running <paramref name="onNone"/>.
131+
/// </returns>
123132
let inline maybe
124133
([<InlineIfLambda>] onNone: unit -> 'output)
125134
([<InlineIfLambda>] onSome: 'a -> 'output)

0 commit comments

Comments
 (0)