-
Nestedscala/cats2 2023. 1. 16. 10:07
cats Nested 예제
import cats.data._ import cats.syntax.all._ import scala.util.{Success, Try} object NestedExample { def main(args: Array[String]): Unit = { val someValue: Try[Option[Int]] = Success(2.some) val basicScala: Try[Option[Int]] = someValue.map(_.map(_ * 3)) val catsScala: Try[Option[Int]] = Nested(someValue).map(_ * 3).value } }