可能重复:
What are type lambdas in Scala and what are their benefits?
如何解决此类型定义:Pure[({type ?[a]=(R, a)})#?]
?
使用这种结构的原因是什么?
Snipped来自scalaz库:
trait Pure[P[_]] {
def pure[A](a: => A): P[A]
}
object Pure {
import Scalaz._
//...
implicit def Tuple2Pure[R: Zero]: Pure[({type ?[a]=(R, a)})#?] = new Pure[({type ?[a]=(R, a)})#?] {
def pure[A](a: => A) = (Ø, a)
}
//...
}