All Downloads are FREE. Search and download functionalities are using the official Maven repository.

superquants.Len.scala Maven / Gradle / Ivy

Go to download

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()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy