Each[Fail, TupleX] を返す式を使用して、成功ブロックでローカル val を定義せずに結果を折り畳むにはどうすればよいですか?
// returns Either[Fail, Tuple2[String, String]]
val result = for{
model <- bindForm(form).right
key <- dao.storeKey(model.email, model.password)
} yield (model.email, key)
result fold (
Conflict(_),
tuple2 => { // want to define email/key on this line
val(email,key) = tuple2
...
}
)