Skip to content

Instantly share code, notes, and snippets.

@TheAngryByrd
Last active May 13, 2026 20:14
Show Gist options
  • Select an option

  • Save TheAngryByrd/24e7862b3a5374e3ad3ae2256b940b7c to your computer and use it in GitHub Desktop.

Select an option

Save TheAngryByrd/24e7862b3a5374e3ad3ae2256b940b7c to your computer and use it in GitHub Desktop.
F# Ignore Explicity
[<AutoOpen>]
module Ignore =
[<RequiresExplicitTypeArguments>]
let inline ignore<'a> (x: 'a) : unit = ignore<'a> x
type Async with
[<RequiresExplicitTypeArguments>]
static member inline Ignore<'a>(x: Async<'a>) : Async<unit> = FSharp.Control.Async.Ignore<'a> x
type System.Threading.Tasks.Task with
[<RequiresExplicitTypeArguments>]
static member inline Ignore<'a>(x: Task<'a>) : Task<unit> =
task {
let! r = x
return ignore<'a> r
}
[<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