Skip to content

Instantly share code, notes, and snippets.

@bretthoerner
Forked from danclien/checking_option.scala
Last active December 20, 2015 22:08
Show Gist options
  • Save bretthoerner/6202196 to your computer and use it in GitHub Desktop.
Save bretthoerner/6202196 to your computer and use it in GitHub Desktop.
//Setup Option[String]s
val maybeValue1 : Option[String] = Some("Value1")
val maybeValue2 : Option[String] = Some("Value2")
val maybeValue3 : Option[String] = None
(maybeValue1, maybeValue2, maybeValue3) match {
case (Some(v1), Some(v2), Some(v3)) => (v1, v2, v3)
case _ => println("Handle error here")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment