I'm reading about scalaz and noticed that we can make a list of Applicative
s to be an Applicative
of List
.
def sequenceA[F[_]: Applicative, A](list: List[F[A]]): F[List[A]] = list match {
case Nil => (Nil: List[A]).point[F]
case x :: xs => (x |@| sequenceA(xs)) {_ :: _}
}
The question is can we do the opposite? Can we transform F[List[A]]
to List[F[A]]
?