Skip to content

Commit

Permalink
RuntimeQuantity
Browse files Browse the repository at this point in the history
  • Loading branch information
erikerlandson committed Feb 2, 2023
1 parent bf1e3be commit 293cf75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime/src/main/scala/coulomb/runtime/runtime.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ object RuntimeUnit:
case class Pow(b: RuntimeUnit, e: Rational) extends RuntimeUnit
inline def of[U]: RuntimeUnit = ${ meta.unitRTU[U] }

case class RuntimeQuantity[V](value: V, unit: RuntimeUnit)

object RuntimeQuantity:
inline def apply[V, U](q: Quantity[V, U]): RuntimeQuantity[V] =
RuntimeQuantity(q.value, RuntimeUnit.of[U])

package syntax {
import scala.util.{Try, Success, Failure}
import coulomb.conversion.*
Expand Down

0 comments on commit 293cf75

Please sign in to comment.