With the recent announcement of cats-effect, a relevant question from the past resurfaces: why does IO
, which is otherwise quite Task
-like, not define both
or race
? To be clear, the type signatures of these functions would be as follows:
object IO {
def both[A, B](ioa: IO[A], iob: IO[B])(implicit EC: ExecutionContext): IO[(A, B)] = ???
def race[A, B](ioa: IO[A], iob: IO[B])(implicit EC: ExecutionContext): IO[Either[A, B]] = ???
}