我在本文中找到了以下代码(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
}
我无法弄清楚特征名称旁边的语法
[->>[_,_]]
我在本文中找到了以下代码(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
}
我无法弄清楚特征名称旁边的语法
[->>[_,_]]
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.