tcpoly_gm.scala

来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 15 行

SCALA
15
字号
trait Rep[a] {             def rep[m[x]]: m[a] // typedTypeApply must use asSeenFrom to adapt the return type   // since rep is called on x: Rep[t]   // a must become t}case class ShowBin[b](app: b => String)object foo {  def showBin[t](x: Rep[t], y: t): String = {    val r: ShowBin[t] = x.rep[ShowBin]    r.app(y)   }} 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?