Skip to content

Commit 293cf75

Browse files
committed
RuntimeQuantity
1 parent bf1e3be commit 293cf75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

runtime/src/main/scala/coulomb/runtime/runtime.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ object RuntimeUnit:
3434
case class Pow(b: RuntimeUnit, e: Rational) extends RuntimeUnit
3535
inline def of[U]: RuntimeUnit = ${ meta.unitRTU[U] }
3636

37+
case class RuntimeQuantity[V](value: V, unit: RuntimeUnit)
38+
39+
object RuntimeQuantity:
40+
inline def apply[V, U](q: Quantity[V, U]): RuntimeQuantity[V] =
41+
RuntimeQuantity(q.value, RuntimeUnit.of[U])
42+
3743
package syntax {
3844
import scala.util.{Try, Success, Failure}
3945
import coulomb.conversion.*

0 commit comments

Comments
 (0)