Skip to content

Instantly share code, notes, and snippets.

@tototoshi
Created April 23, 2012 02:57
Show Gist options
  • Save tototoshi/2468534 to your computer and use it in GitHub Desktop.
Save tototoshi/2468534 to your computer and use it in GitHub Desktop.
地味につらい
/* これはできる */
val o = Some(("foo", 1))
for {
(s, i) <- o
} yield {
println(s)
println(i)
}
/*
これはできない
val r = Right(("foo", 1))
for {
(s, i) <- r.right
} yield {
println(s)
println(i)
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment