Created
March 10, 2017 06:30
-
-
Save yoshiyoshifujii/3eb7d058c10fd022bf4dd7ef2a317622 to your computer and use it in GitHub Desktop.
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
def splitEither[A,B](el: Seq[Either[A,B]]): (Seq[A], Seq[B]) = { | |
val (lefts, rights) = el.partition(_.isLeft) | |
(lefts.map(_.left.get), rights.map(_.right.get)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment