nam
nam

Reputation: 3632

cats-effect: How to transform `List[IO[A]]` to `IO[List[A]]`

I have an List[IO[A]] and I want to convert it to an IO[List[A]] In scalaz I would use sequenceU but I don't find the equivalent in cats

Upvotes: 0

Views: 699

Answers (1)

nam
nam

Reputation: 3632

This solved my problems

import cats.implicits._

val x: List[IO[A]] = ...
val y: IO[List[A]] = x.sequence

Upvotes: 1

Related Questions