Created
January 21, 2021 10:27
-
-
Save SebastianAas/60b16368cf8c31d010635c85b970e261 to your computer and use it in GitHub Desktop.
Companion class SetF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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