Skip to content

Commit

Permalink
Merge pull request #164 from roc-lang/fix-task
Browse files Browse the repository at this point in the history
Fix Task.roc
  • Loading branch information
rtfeldman authored Jan 26, 2024
2 parents 0896641 + 3a8d619 commit 7171874
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions platform/Task.roc
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ batch = \current -> \next ->
##
seq : List (Task ok err) -> Task (List ok) err
seq = \tasks ->
List.walk tasks (Task.ok []) \state, task ->
value <- task |> Task.await
List.walk tasks (InternalTask.ok []) \state, task ->
value <- task |> await

state |> Task.map \values -> List.append values value
state |> map \values -> List.append values value

## Apply a task repeatedly for each item in a list
##
Expand All @@ -241,5 +241,5 @@ seq = \tasks ->
##
forEach : List a, (a -> Task {} b) -> Task {} b
forEach = \items, fn ->
List.walk items (Task.ok {}) \state, item ->
state |> Task.await \_ -> fn item
List.walk items (InternalTask.ok {}) \state, item ->
state |> await \_ -> fn item

0 comments on commit 7171874

Please sign in to comment.