Skip to content

Why is there no DoAsync? #1277

Answered by louthy
ReneWiersma asked this question in Q&A
Nov 17, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Why is there no DoAsync?

For no reason other than I don't have infinite time and sometimes things don't get written :D

Note, that all *Async stuff will be going away in v5. You will be able to 'lift' async code into the IO and Eff monads:

static IO<Unit> waitOneSecond =>
    liftIO(async _ => 
    {
        await Task.Delay(1000);
        return unit;
    });

Which will mean that running waitOneSecond will run the computation concurrently without it having to be an Async variant.

Do is a little bit of a code-smell, so be wary of using it too much. It's a bit of an admission that you're injecting side-effects into your computation, which is usually something to avoid.

You can use MapAsync

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ReneWiersma
Comment options

Answer selected by ReneWiersma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants