superquants.Len.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of superquants_2.11 Show documentation
Show all versions of superquants_2.11 Show documentation
Scala: Typelevel unboxed compile time dimensional analysis over tagged types. Intellij Idea compatible 100%
The newest version!
package superquants
import shapeless.{HList, Nat}
import shapeless.ops.hlist.Length
import shapeless.ops.nat.ToInt
/**
* For debug. Easy-tracing implicit calls
*/
trait Len[H <: HList] {
def apply():Int
}
object Len {
implicit def lenImpl[H <: HList, N <: Nat](implicit len:Length.Aux[H,N], toInt:ToInt[N]):Len[H] = new Len[H] {
def apply():Int = toInt.apply()
}
}