Open
Description
Replaces #128. TaskEx top level issue: #139
Async.Ignore
has always been ugly and undiscoverable. While I tend to make ignoring explicit by using let! _ = <async stuff I want to ignore result of>
, it's commonly the last expression in a function, and having to do let! _ = <thing I'm wrapping> in ()
is too much.
It is proposed that the module
associated with any given builder should by convention have an ignore
function that correctly observes completion of the work, dropping the result, but propagating exceptions, if any
Current proposed APIs that are not currently in FSharp.Core
(will be updated inline based on discussion below):
module Async =
let inline ignore (a : Async<'t>) = Async.Ignore
module Task =
let inline ignore (t : Task<'t>) = ...
module ValueTask =
let inline ignore (t : ValueTask<'t>) = ...
NOTES:
- Currently,
TaskSeq
(and other libs such as IcedTasks contain various bespoke implementations - While this could live in a TaskEx lib, it could be argued that
FSharp.Core
is the obvious home for them. (However that would raise the issue of whether they need to go into the 6.x release line in order to align with minimal dependencies for various common libraries)