Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does λ[α =>F] mean? [duplicate]

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.

like image 661
Binzi Cao Avatar asked Nov 19 '25 09:11

Binzi Cao


1 Answers

scalaz use kind-projector.

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

  • https://github.com/non/kind-projector
  • https://github.com/scalaz/scalaz/pull/875
like image 50
Kenji Yoshida Avatar answered Nov 22 '25 03:11

Kenji Yoshida