polyadic / funcky

Funcky is a Functional Library for C#
https://polyadic.github.io/funcky
Apache License 2.0
19 stars 4 forks source link

Re-add `OptionTaskAwaiter` #655

Closed bash closed 2 years ago

bash commented 2 years ago

Workaround:

Option<Task> x = ...;
await x.GetOrElse(Task.CompletedTask);
bash commented 2 years ago

The IRL discussion was about the removal of OptionTaskAwaiter in general.

We don't like implicit things, such as this awaiter (Technically an Option<Task> is not a Task, why would it be awaitable?).

On the other hand the new solution using .Sequence() adds additional noise to the already noisy async world.

We decided to re-add the OptionTaskAwaiters and the ConfigureAwait extension method.