From 276bc287d52b9a6c318d13335596c2497464a0d4 Mon Sep 17 00:00:00 2001 From: Joseph Price Date: Tue, 7 Jan 2025 18:57:05 -0500 Subject: [PATCH] add explicit type param to ignore (#300) * add explicit type param to ignore * add explicit type param to Option.ignore --- src/FsToolkit.ErrorHandling/Option.fs | 2 +- src/FsToolkit.ErrorHandling/Task.fs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/FsToolkit.ErrorHandling/Option.fs b/src/FsToolkit.ErrorHandling/Option.fs index 32a8066a..50495d26 100644 --- a/src/FsToolkit.ErrorHandling/Option.fs +++ b/src/FsToolkit.ErrorHandling/Option.fs @@ -83,7 +83,7 @@ module Option = /// /// The option to ignore. /// A unit option. - let inline ignore (opt: 'T option) : unit option = + let inline ignore<'T> (opt: 'T option) : unit option = match opt with | Some _ -> Some() | None -> None diff --git a/src/FsToolkit.ErrorHandling/Task.fs b/src/FsToolkit.ErrorHandling/Task.fs index fb5dfb07..4aa0091a 100644 --- a/src/FsToolkit.ErrorHandling/Task.fs +++ b/src/FsToolkit.ErrorHandling/Task.fs @@ -44,10 +44,11 @@ module Task = let inline map3 ([] 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 {