在 type lambda 中我们会用到 Path Dependent 和 Structural Types,所以如果你跳过了这些章节,你可能需要回去回顾下。
了解 Type Lambdas 之前,让我们回头看看函数和柯里化。
class EitherMonad[A] extends Monad[({type λ[α] = Either[A, α]})#λ] {
def point[B](b: B): Either[A, B]
def bind[B, C](m: Either[A, B])(f: B => Either[A, C]): Either[A, C]
}