Skip to content

Instantly share code, notes, and snippets.

@giftig
Created January 5, 2015 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giftig/db182b372daa11b34437 to your computer and use it in GitHub Desktop.
Save giftig/db182b372daa11b34437 to your computer and use it in GitHub Desktop.
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