Implementation should also make it easy to extend to Maybe/Result/Random/Parser.Extra.sequence/combine in the future
Task.sequence [ Task.succeed a, Task.succeed b ]
--> Task.succeed [ a, b ]
Task.sequence [ Task.succeed a, Task.fail x ]
--> Task.fail x
Task.sequence [ task ]
--> Task.map List.singleton task
Task.sequence [ a, Task.fail x, b ]
--> Task.sequence [ a, Task.fail x ]
-- for example not in summary
Task.sequence << List.singleton
--> Task.map List.singleton
-- not in summary because theoretically same case as the first but with a separate error
Task.sequence []
--> Task.succeed []
Note that we do not simplify
Task.sequence [ task, Task.fail x ]
--> Task.fail x
because task could fail earlier.
We also don't simplify it to
Implementation should also make it easy to extend to
Maybe/Result/Random/Parser.Extra.sequence/combine
in the futureNote that we do not simplify
because
task
could fail earlier. We also don't simplify it tobecause this is arguably a code style choice.