Skip to content

Instantly share code, notes, and snippets.

@SebastianAas
Created January 21, 2021 10:27
Show Gist options
  • Save SebastianAas/60b16368cf8c31d010635c85b970e261 to your computer and use it in GitHub Desktop.
Save SebastianAas/60b16368cf8c31d010635c85b970e261 to your computer and use it in GitHub Desktop.
Companion class SetF
object SetF {
def lift[A](f: Future[A]): SetF[A] = SetF(f.map(Set(_)))
def apply[A](o: Iterable[A]): SetF[A] =
SetF(Future.successful(o match {
case o: Set[_] => o.asInstanceOf[Set[A]]
case o => o.toSet
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment