Race to the Finish

par.race() returns the first winner

Why it matters

  • `par.race()` returns the fastest competitor and cancels the rest.
  • Ideal for composing timeouts and fallback strategies functionally.
par.race()AsyncConsole Console.capture()Async.default()Exception.tryCatch()
Program
const race = () =>
  seq()
    .let(() => par.race(competitors.map(c => () => compete(c))))
    .value();

Awaiting execution

Console output, timeline events will render here after you run the program.

Handlers: Console.capture() · Async.default() · Exception.tryCatch()