Pattern match on value of Either inside a for comprehension?
问题 I have a for comprehension like this: for { (value1: String, value2: String, value3: String) <- getConfigs(args) // more stuff using those values } getConfigs returns an Either[Throwable, (Seq[String], String, String)] and when I try to compile I get this error: value withFilter is not a member of Either[Throwable,(Seq[String], String, String)] How can I use this method (that returns an Either ) in the for comprehension? 回答1: Like this: for { tuple <- getConfigs() } println(tuple) Joking