Created
January 5, 2015 21:54
-
-
Save giftig/db182b372daa11b34437 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
scala> val hmm: Option[String] = Some("lala") | |
scala> hmm collect {{ | |
| case rawr if rawr == "lala" => rawr * 2 | |
| }: PartialFunction[String, String]} | |
res2: Option[String] = Some(lalalala) | |
scala> res2 ++ List("teehee") | |
res3: Iterable[String] = List(lalalala, teehee) | |
scala> hmm collect {{ | |
| case rawr if rawr == "lala" => rawr * 2 | |
| }: PartialFunction[String, String]} ++ List("teehee") | |
<console>:11: error: value ++ is not a member of PartialFunction[String,String] | |
}: PartialFunction[String, String]} ++ List("teehee") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment