Skip to content

Instantly share code, notes, and snippets.

@hvesalai
Created March 13, 2015 13:04
Show Gist options
  • Save hvesalai/a8bf39e25f53bcd2efcb to your computer and use it in GitHub Desktop.
Save hvesalai/a8bf39e25f53bcd2efcb to your computer and use it in GitHub Desktop.
def (o1: Option[B], o2: Option[C]): A = {
val a: A = new A
val b: A = o1.map(o => A.foo(o)).getOrElse(a)
o2.map(o => A.bar(o)).getOrElse(b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment