Skip to content

Commit

Permalink
add explicit type param to ignore (#300)
Browse files Browse the repository at this point in the history
* add explicit type param to ignore

* add explicit type param to Option.ignore
  • Loading branch information
joprice authored Jan 7, 2025
1 parent 519f968 commit 276bc28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/FsToolkit.ErrorHandling/Option.fs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module Option =
/// </summary>
/// <param name="opt">The option to ignore.</param>
/// <returns>A unit option.</returns>
let inline ignore (opt: 'T option) : unit option =
let inline ignore<'T> (opt: 'T option) : unit option =
match opt with
| Some _ -> Some()
| None -> None
Expand Down
3 changes: 2 additions & 1 deletion src/FsToolkit.ErrorHandling/Task.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ module Task =
let inline map3 ([<InlineIfLambda>] f) x y z = apply (map2 f x y) z

/// Allows us to call `do!` syntax inside a computation expression
let inline ignore (x: Task<'a>) =
let inline ignore<'a> (x: Task<'a>) =
x
|> map ignore


/// Takes two tasks and returns a tuple of the pair
let zip (a1: Task<_>) (a2: Task<_>) =
task {
Expand Down

0 comments on commit 276bc28

Please sign in to comment.