Last active
October 12, 2015 12:31
-
-
Save tomaszperek/fbd658a7f6a5f3d62b46 to your computer and use it in GitHub Desktop.
Usual way to limit size of lists
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 acceptSameSize[T](l: Seq[List[T]]): Unit = { | |
if (l.exists(_.size != 2)) throw new IllegalArgumentException("list has incorrect size!") | |
// do something | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment