28 ms·
Here `a` and `b` can have different types: let! a = fetchA() and! b = fetchB() Whereas `Promise.all` usually requires all promises to have the same type (
by greener_grass 10mo ago
Here `a` and `b` can have different types:
let! a = fetchA() and! b = fetchB()
Whereas `Promise.all` usually requires all promises to have the same type (returning a `List<T>` or even a `List<obj>`)
.
See https://learn.microsoft.com/en-us/dotnet/fsharp/whats-new/fsharp-10#support-for-and-in-task-expressions https://learn.microsoft.com/en-us/dotnet/fsharp/whats-new/fs...
- ajifurai 10mo agoActually, TypeScript's `Promise.all` can handle different types too. const [a, b] = await Promise.all([fetchA(), fetchB()]); // => a: A, b: B
- greener_grass 10mo agoI am talking about C# / F# context where the lists must have homogeneous types. That TypeScript supports this is yet more complexity introduced to cover usages of an API not designed around types.