Skip to content

Instantly share code, notes, and snippets.

@leifwickland
Created July 22, 2011 17:01
Show Gist options
  • Save leifwickland/1099861 to your computer and use it in GitHub Desktop.
Save leifwickland/1099861 to your computer and use it in GitHub Desktop.
Here's one solution I found for fighting with type erasure warnings.
object typeErasure {
def main(args: Array[String]) {
val evenOdd = 1.to(10)
.map{x => if (x%2==0) { Option[Int](x) } else { None } }
.partition{ case Some(_) => true case _ => false }
println(evenOdd)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment