scalazscalaz7kind-projector

What does λ[α =>F] mean?


I'm learning Scalaz recently. I would like to know how λ[α =>F] works?

scala> Applicative[λ[α => Int]].point(10)
res45: Int = 0

scala> Applicative[λ[α => String]].point(10)
res46: String = ""

I can understand λ means some type here, but I could not find its definition and would like to know how the above code works.


Solution

  • scalaz use kind-projector.

    Applicative[λ[α => Int]] is equivalent to Applicative[({type l[a] = Int})#l]