有人可以解释嵌套在泛型中的结构类型的奇怪构造:
implicit def Function1Functor[R]: Functor[({type λ[α]=(R) => α})#λ] =
new Functor[({type λ[α]=(R) => α})#λ] ....
这个例子来自 Scalaz 库:Functor.scala
为什么那里需要这种结构?写起来不会更简单:
implicit def Function1Functor[R,A]: Functor[R =>A]
或者
implicit def Function1Functor[R,A]: Functor[Function1[R,A]]