我在本文中找到了以下代码(http://hseeberger.wordpress.com/2010/11/25/introduction-to-category-theory-in-scala/ 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 高等类型 https://stackoverflow.com/questions/6246719/what-is-a-higher-kinded-type-in-scala,很好地描述了这个介绍 http://wiki.ifs.hsr.ch/SemProgAnTr/files/HigherKindGenericsInScala.pdf并在这个研究论文 http://adriaanm.github.io/files/higher.pdf.
您可能会觉得令人困惑的原因是->>
是高等类型的名称——它也可能被称为Arrow
反而。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)