Slide 49
Slide 49 text
def separateSequence[F[_], A, B](list: List[EitherT[F,A,B]])
(implicit M: Monad[F]): F[(List[A],List[B])] = {!
list.foldRight(M.point((List[A](), List[B]())))( (et, ftup) => {!
for {!
e <- et.run!
t <- ftup!
} yield e.fold(a => (a :: t._1,t._2), b => (t._1, b :: t._2)) !
})!
}!