We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
race
1 parent ae4668f commit a96c742Copy full SHA for a96c742
src/ConcurrentTask.elm
@@ -848,10 +848,13 @@ race task tasks =
848
toRacer =
849
mapError RaceError >> andThen (Winner >> fail)
850
in
851
- List.map toRacer (task :: tasks)
852
- |> batch
853
- -- This makes the types match up but will never be run, as one of the sub task will always `fail` with a `Winner`.
854
- |> andThen (List.head >> Maybe.map succeed >> Maybe.withDefault (toRacer task))
+ map2
+ (\h _ ->
+ -- This makes the types match up but will never be run, as one of the sub task will always `fail` with a `Winner`.
+ never h
855
+ )
856
+ (toRacer task)
857
+ (batch (List.map toRacer tasks))
858
|> onError
859
(\e ->
860
case e of
0 commit comments