Created
December 13, 2017 14:38
-
-
Save jto/e67c75a34924dd6fc87fb23dfd88c8d3 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
val xs = List("1", "2", "3", "foo", "bar", "4") | |
def isAnInt(s: String): Boolean = s.matches("""-?\d+""") | |
def toInts(is: List[String]): List[Int] = { | |
??? | |
} | |
val out = List(1, 2, 3, 4) | |
assert(toInts(xs) == out, s"${toInts(xs)} n'est pas égal à $out") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment