scalan.DFunc.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common_2.12 Show documentation
Show all versions of common_2.12 Show documentation
Compiling Scala to Something special
The newest version!
package scalan
/** Function interface which support specialization and thus unboxed invocations. */
abstract class DFunc[@specialized(Int) A, B] {
def apply(x: A): B
}
/** Convenient but SLOW adapter to be used in tests. */
class DFuncAdapter[A,B](f: A => B) extends DFunc[A, B] {
override def apply(x: A): B = f(x)
}