Last active
May 19, 2025 16:08
-
-
Save TheAngryByrd/24e7862b3a5374e3ad3ae2256b940b7c to your computer and use it in GitHub Desktop.
F# Ignore Explicity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<AutoOpen>] | |
module Ignore = | |
[<RequiresExplicitTypeArguments>] | |
let inline ignore<'a> (x: 'a) : unit = ignore<'a> x | |
type Async = | |
[<RequiresExplicitTypeArguments>] | |
static member inline Ignore<'a>(x: Async<'a>) : Async<unit> = FSharp.Control.Async.Ignore<'a> x | |
type Task = | |
[<RequiresExplicitTypeArguments>] | |
static member inline Ignore<'a>(x: Task<'a>) : Task<unit> = | |
x.ContinueWith(Func<Task<'a>, unit>(fun _ -> ()), TaskContinuationOptions.ExecuteSynchronously) | |
[<RequiresExplicitTypeArguments>] | |
static member inline IgnoreArg<'a>(x: Task<'a>) : System.Threading.Tasks.Task = x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment