Pre SIP: Demote match keyword to a method

My preference would be to move the yield into the for comprehension, since scope-wise that is where the symbols are defined.

for { f <- foo; b <- bar; yield baz(f,b) }

Then you could easily get the match-example working:

for {
  f <- foo
  b <- bar
  yield baz(f,b)
} match {
  case … => ???
}
8 Likes