Skip to content

Commit

Permalink
Add doc for Option.maybe.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdziadkiewicz authored and TheAngryByrd committed Oct 31, 2022
1 parent 348e4f2 commit 4ac6a5b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/FsToolkit.ErrorHandling/Option.fs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ module Option =
|> ofNull
| None -> None

/// <summary>
/// Returns result of running <paramref name="onSome"/> if it is <c>Some</c>, otherwise returns result of running <paramref name="onNone"/>
/// </summary>
/// <param name="onNone">The function to run if <paramref name="input"/> is <c>None</c></param>
/// <param name="onSome">The function to run if <paramref name="input"/> is <c>Some</c></param>
/// <param name="input">The input option.</param>
/// <returns>
/// The result of running <paramref name="onSome"/> if the input is <c>Some</c>, else returns result of running <paramref name="onNone"/>.
/// </returns>
let inline maybe
([<InlineIfLambda>] onNone: unit -> 'output)
([<InlineIfLambda>] onSome: 'a -> 'output)
Expand Down

0 comments on commit 4ac6a5b

Please sign in to comment.