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

Task.sequence runs the tasks in reverse order #235

Closed
ageron opened this issue Jul 29, 2024 · 1 comment
Closed

Task.sequence runs the tasks in reverse order #235

ageron opened this issue Jul 29, 2024 · 1 comment

Comments

@ageron
Copy link

ageron commented Jul 29, 2024

I was surprised to see that Task.sequence runs the tasks in reverse order. If this is working as expected, then the documentation should clearly state this.

For example:

app [main] { cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.12.0/Lb8EgiejTUzbggO2HVVuPJFkwvvsfW6LojkLR20kTVE.tar.br" }

import cli.Task
import cli.Stdout

run : U8 -> Task.Task _ _
run = \n ->
    n |> Num.toStr |> Stdout.line!

main =
    _ = [1,2,3] |> List.map run |> Task.sequence!
    Task.ok {}

Prints this:

3
2
1
@lukewilliamboswell
Copy link
Collaborator

Fixed in roc-lang/roc#6836 builtin-task commit aabe75ff87bd105e293eb1e7c6944f9fc6141ffd

@ageron ageron closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants