Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskEx: ignore #140

Open
bartelink opened this issue Jan 5, 2023 · 0 comments
Open

TaskEx: ignore #140

bartelink opened this issue Jan 5, 2023 · 0 comments
Labels
feature request New feature or enhancement request topic: task-ex Related to the proposed new TaskEx library, which should get its own oss haven
Milestone

Comments

@bartelink
Copy link
Member

bartelink commented Jan 5, 2023

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:

  1. Currently, TaskSeq (and other libs such as IcedTasks contain various bespoke implementations
  2. 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)
This was referenced Jan 5, 2023
@bartelink bartelink changed the title TaskShims: ignore TaskEx: ignore Jan 10, 2023
@abelbraaksma abelbraaksma added feature request New feature or enhancement request topic: task-ex Related to the proposed new TaskEx library, which should get its own oss haven labels Oct 29, 2023
@abelbraaksma abelbraaksma added this to the vFuture milestone Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or enhancement request topic: task-ex Related to the proposed new TaskEx library, which should get its own oss haven
Projects
None yet
Development

No branches or pull requests

2 participants