Skip to content

Instantly share code, notes, and snippets.

@vmarquez
Last active January 13, 2016 05:23
Show Gist options
  • Save vmarquez/397c8462914e9e790ffa to your computer and use it in GitHub Desktop.
Save vmarquez/397c8462914e9e790ffa to your computer and use it in GitHub Desktop.
SeparateTasks.scala
def taskSeparation[F[_], A](fa: List[F[A]])(implicit M: Catchable[F], N: Nondeterminism[F]): F[(List[Throwable], List[A])] =
N.gatherUnordered(fa.map(f => M.attempt(f))).map(_.separate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment