我遇到了很多我有类似东西的地方
def f(s: String): Option[Long] = ...
def g(l: Long): IO[Option[Wibble]] = ...
val a: IO[Option[Wibble]] = f(param).flatMap(g).sequence.map(_.join)
Run Code Online (Sandbox Code Playgroud)
看到.sequence.map(_.join)重复一遍又一遍,开始困扰我.有没有更惯用的方式来完成同样的事情?