I have the following code:
import cats._
import cats.Functor
object StudyIt {
def main(args: Array[String]): Unit = {
val one: Int = 1
val a = Functor[Id].map(one)(_ + 1)
println(a)
}
}
As you can see, map
expects the type of Id[Int]
but I just past Int
to map
, why it is possible?