4

我在本文中找到了以下代码(http://hseeberger.wordpress.com/2010/11/25/introduction-to-category-theory-in-scala/)。

trait GenericCategory[->>[_, _]] {
  def id[A]: A ->> A
  def compose[A, B, C](g: B ->> C, f: A ->> B): A ->> C
}

我无法弄清楚特征名称旁边的语法

[->>[_,_]]
4

1 回答 1

8

It's a higher-kinded type, described nicely in this introduction and in this research paper.

The reason you might find it confusing is that ->> is the name for the higher-kinded type -- it might have as well been called Arrow instead.

于 2013-04-10T13:07:50.910 回答