Last active
May 13, 2026 20:14
-
-
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 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