Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 487 Bytes

type_lambda.adoc

File metadata and controls

12 lines (9 loc) · 487 Bytes

Type Lambda

在 type lambda 中我们会用到 Path DependentStructural 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]
}